Certificate provider log update
Add 'UpdatedCertificate' event and renamed some existing log types.
This commit is contained in:
@@ -21,8 +21,10 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
|||||||
RetrievalCertificateError,
|
RetrievalCertificateError,
|
||||||
Allocated = 40,
|
Allocated = 40,
|
||||||
AllocationFailed = 50,
|
AllocationFailed = 50,
|
||||||
Disabled = 100,
|
DisabledCertificate = 100,
|
||||||
Deleted = 120
|
EnabledCertificate = 110,
|
||||||
|
DeletedCertificate = 120,
|
||||||
|
UpdatedCertificate = 130
|
||||||
}
|
}
|
||||||
private const int _ModuleId = 60;
|
private const int _ModuleId = 60;
|
||||||
private static bool _IsCertificateRetrievalProcessing;
|
private static bool _IsCertificateRetrievalProcessing;
|
||||||
@@ -122,14 +124,23 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
|||||||
{
|
{
|
||||||
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.AllocationFailed, DeviceSerialNumber);
|
CertificateProvidersLog.Log(CertificateProvidersLog.EventTypeIds.AllocationFailed, DeviceSerialNumber);
|
||||||
}
|
}
|
||||||
public static void LogDisabled(DeviceCertificate Certificate, string Reason)
|
public static void LogDisabledCertificate(DeviceCertificate Certificate, string Reason)
|
||||||
{
|
{
|
||||||
CertificateProvidersLog.Log(EventTypeIds.Disabled, Certificate.Name, Certificate.Id, Reason);
|
CertificateProvidersLog.Log(EventTypeIds.DisabledCertificate, Certificate.Name, Certificate.Id, Reason);
|
||||||
}
|
}
|
||||||
public static void LogDeleted(DeviceCertificate Certificate, string Reason)
|
public static void LogEnabledCertificate(DeviceCertificate Certificate, string Reason)
|
||||||
{
|
{
|
||||||
CertificateProvidersLog.Log(EventTypeIds.Deleted, Certificate.Name, Certificate.Id, Reason);
|
CertificateProvidersLog.Log(EventTypeIds.EnabledCertificate, Certificate.Name, Certificate.Id, Reason);
|
||||||
}
|
}
|
||||||
|
public static void LogDeletedCertificate(DeviceCertificate Certificate, string Reason)
|
||||||
|
{
|
||||||
|
CertificateProvidersLog.Log(EventTypeIds.DeletedCertificate, Certificate.Name, Certificate.Id, Reason);
|
||||||
|
}
|
||||||
|
public static void LogUpdatedCertificate(DeviceCertificate Certificate, string Reason)
|
||||||
|
{
|
||||||
|
CertificateProvidersLog.Log(EventTypeIds.UpdatedCertificate, Certificate.Name, Certificate.Id, Reason);
|
||||||
|
}
|
||||||
|
|
||||||
public static void LogCertificateRetrievalProgress(bool? IsProcessing, int? Progress, string Status)
|
public static void LogCertificateRetrievalProgress(bool? IsProcessing, int? Progress, string Status)
|
||||||
{
|
{
|
||||||
bool flag = IsProcessing.HasValue;
|
bool flag = IsProcessing.HasValue;
|
||||||
@@ -290,7 +301,7 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
|||||||
},
|
},
|
||||||
new LogEventType
|
new LogEventType
|
||||||
{
|
{
|
||||||
Id = (int)EventTypeIds.Disabled,
|
Id = (int)EventTypeIds.DisabledCertificate,
|
||||||
ModuleId = 60,
|
ModuleId = 60,
|
||||||
Name = "Disabled Certificate",
|
Name = "Disabled Certificate",
|
||||||
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
||||||
@@ -301,7 +312,18 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
|||||||
},
|
},
|
||||||
new LogEventType
|
new LogEventType
|
||||||
{
|
{
|
||||||
Id = (int)EventTypeIds.Deleted,
|
Id = (int)EventTypeIds.EnabledCertificate,
|
||||||
|
ModuleId = 60,
|
||||||
|
Name = "Enabled Certificate",
|
||||||
|
Format = "Certificate Disabled: {0} [{1}], Reason: {2}",
|
||||||
|
Severity = 0,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.DeletedCertificate,
|
||||||
ModuleId = 60,
|
ModuleId = 60,
|
||||||
Name = "Deleted Certificate",
|
Name = "Deleted Certificate",
|
||||||
Format = "Certificate Deleted: {0} [{1}], Reason: {2}",
|
Format = "Certificate Deleted: {0} [{1}], Reason: {2}",
|
||||||
@@ -309,6 +331,17 @@ namespace Disco.Services.Plugins.Features.CertificateProvider
|
|||||||
UseLive = true,
|
UseLive = true,
|
||||||
UsePersist = true,
|
UsePersist = true,
|
||||||
UseDisplay = true
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.UpdatedCertificate,
|
||||||
|
ModuleId = 60,
|
||||||
|
Name = "Updated Certificate",
|
||||||
|
Format = "Certificate Updated: {0} [{1}], Reason: {2}",
|
||||||
|
Severity = 0,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user