DefaultLoggerService
Wisej.AI.Services.DefaultLoggerService
Last updated
Wisej.AI.Services.DefaultLoggerService
Last updated
Namespace: Wisej.AI.Services
Assembly: Wisej.AI (3.5.0.0)
Provides a default implementation of the for logging messages and exceptions.
This class implements the interface, offering methods to log messages and exceptions at various trace levels.
Initializes a new instance of .
Provides functionality to log messages at various trace levels.
level
The trace level at which the message should be logged.
context
A string representing the name of the class and the method that called the logger.
message
The message to be logged. This parameter supports composite formatting.
arguments
An array of objects to format the message with. This parameter is optional.
This method allows for logging messages with different severity levels, facilitating the tracking of information, warnings, and errors. Depending on the level specified, the method will route the message to the appropriate logging method. The supported trace levels are:
Logs an exception at a specified trace level.
level
The trace level at which the exception should be logged.
context
A string representing the name of the class and the method that called the logger.
exception
The exception to be logged.
This method is designed to log exceptions, allowing for a structured approach to error handling and diagnostics. The level parameter determines the severity of the log entry. Example usage of the method:
Defines a contract for logging services that support logging messages with a specified trace level and optional formatting arguments.
: No logging is performed.
: Logs informational messages.
: Logs error messages.
: Logs warning messages.
Here is an example of how to use the method: