Class EventLogServiceExtensions
Extension methods for the IEventLogService
public static class EventLogServiceExtensions
- Inheritance
-
objectEventLogServiceExtensions
Remarks
These extension methods are maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.
Methods
LogError(IEventLogService, string, string, string, LoggingPolicy)
Writes a new error to the event log.
public static void LogError(this IEventLogService eventLogService, string source, string eventCode, string eventDescription = null, LoggingPolicy loggingPolicy = null)
Parameters
eventLogService
IEventLogServiceEvent log service that logs the arguments
source
stringSource of the event (Content, Administration, etc.)
eventCode
stringEvent code (Security, Update, Delete, etc.)
eventDescription
stringAdditional event information
loggingPolicy
LoggingPolicyLogging policy
Remarks
Parameters source
and eventCode
are limited to 100 characters.
If a longer value needs to be logged, use the eventDescription
parameter.
This method is maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.
LogEvent(IEventLogService, EventTypeEnum, string, string, string)
Writes a new record to the event log.
public static void LogEvent(this IEventLogService eventLogService, EventTypeEnum eventType, string source, string eventCode, string eventDescription = null)
Parameters
eventLogService
IEventLogServiceEvent log service that logs the arguments
eventType
EventTypeEnumType of the event EventTypeEnum
source
stringSource of the event (Content, Administration, etc.)
eventCode
stringEvent code (UPDATEDOC, SENDEMAIL, DELETE, etc.)
eventDescription
stringDetailed description of the event
Remarks
Parameters source
and eventCode
are limited to 100 characters.
If a longer value needs to be logged, use the eventDescription
parameter.
This method is maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.
LogException(IEventLogService, string, string, Exception, string, LoggingPolicy)
Writes a new error to the event log.
public static void LogException(this IEventLogService eventLogService, string source, string eventCode, Exception ex, string additionalMessage = null, LoggingPolicy loggingPolicy = null)
Parameters
eventLogService
IEventLogServiceEvent log service that logs the arguments
source
stringSource of the event (Content, Administration, etc.)
eventCode
stringEvent code (UPDATEDOC, SENDEMAIL, DELETE, etc.)
ex
ExceptionException to be logged
additionalMessage
stringAdditional information to the exception message
loggingPolicy
LoggingPolicyLogging policy.
Remarks
Parameters source
and eventCode
are limited to 100 characters.
If a longer value needs to be logged, use the additionalMessage
parameter.
This method is maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.
LogInformation(IEventLogService, string, string, string, LoggingPolicy)
Writes a new information to the event log.
public static void LogInformation(this IEventLogService eventLogService, string source, string eventCode, string eventDescription = null, LoggingPolicy loggingPolicy = null)
Parameters
eventLogService
IEventLogServiceEvent log service that logs the arguments
source
stringSource of the event (Content, Administration, etc.)
eventCode
stringEvent code (Security, Update, Delete, etc.)
eventDescription
stringAdditional event information
loggingPolicy
LoggingPolicyLogging policy
Remarks
Parameters source
and eventCode
are limited to 100 characters.
If a longer value needs to be logged, use the eventDescription
parameter.
This method is maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.
LogWarning(IEventLogService, string, string, Exception, string, LoggingPolicy)
Writes a new warning to the event log.
public static void LogWarning(this IEventLogService eventLogService, string source, string eventCode, Exception ex, string additionalMessage = null, LoggingPolicy loggingPolicy = null)
Parameters
eventLogService
IEventLogServiceEvent log service that logs the arguments
source
stringSource of the event (Content, Administration, etc.)
eventCode
stringEvent code (UPDATEDOC, SENDEMAIL, DELETE, etc.)
ex
ExceptionException to be logged
additionalMessage
stringAdditional information to the exception message
loggingPolicy
LoggingPolicyLogging policy
Remarks
Parameters source
and eventCode
are limited to 100 characters.
If a longer value needs to be logged, use the additionalMessage
parameter.
This method is maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.
LogWarning(IEventLogService, string, string, string, LoggingPolicy)
Writes a new warning to the event log.
public static void LogWarning(this IEventLogService eventLogService, string source, string eventCode, string eventDescription = null, LoggingPolicy loggingPolicy = null)
Parameters
eventLogService
IEventLogServiceEvent log service that logs the arguments
source
stringSource of the event (Content, Administration, etc.)
eventCode
stringEvent code (Security, Update, Delete, etc.)
eventDescription
stringAdditional event information
loggingPolicy
LoggingPolicyLogging policy
Remarks
Parameters source
and eventCode
are limited to 100 characters.
If a longer value needs to be logged, use the eventDescription
parameter.
This method is maintained for backward compatibility. For new development, use Microsoft.Extensions.Logging.ILogger instead.