Interface ILoggerComponent
Interface for a component-specific logger with categorized logging capabilities.
Namespace: Serenity.Logging.Application.Interfaces
Assembly: Serenity.Global.Application.dll
Syntax
public interface ILoggerComponent : IComponent, IFoundationSettings
Properties
Category
Gets the category of the logger.
Declaration
string Category { get; }
Property Value
| Type | Description |
|---|---|
| string | The category as a string. |
EffectiveVerbosity
Gets the effective verbosity level for the logger.
Declaration
LogVerbosity EffectiveVerbosity { get; }
Property Value
| Type | Description |
|---|---|
| LogVerbosity | The effective verbosity level. |
Methods
IsEnabledFor(LogSeverity)
Checks if logging is enabled for the specified severity level.
Declaration
bool IsEnabledFor(LogSeverity severity)
Parameters
| Type | Name | Description |
|---|---|---|
| LogSeverity | severity | The severity level to check. |
Returns
| Type | Description |
|---|---|
| bool | True if logging is enabled for the specified severity; otherwise, false. |
WriteErrorLog(string, params string[])
Writes an error log message.
Declaration
void WriteErrorLog(string message, params string[] tags)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The log message. |
| string[] | tags | Optional tags for the log message. |
WriteExceptionLog(Exception, string, params string[])
Writes an exception log message.
Declaration
void WriteExceptionLog(Exception exception, string message = null, params string[] tags)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | exception | The exception to log. |
| string | message | An optional custom message. |
| string[] | tags | Optional tags for the log message. |
WriteInfoLog(string, params string[])
Writes an informational log message.
Declaration
void WriteInfoLog(string message, params string[] tags)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The log message. |
| string[] | tags | Optional tags for the log message. |
WriteVerboseLog(string, params string[])
Writes a verbose log message.
Declaration
void WriteVerboseLog(string message, params string[] tags)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The log message. |
| string[] | tags | Optional tags for the log message. |
WriteWarningLog(string, params string[])
Writes a warning log message.
Declaration
void WriteWarningLog(string message, params string[] tags)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The log message. |
| string[] | tags | Optional tags for the log message. |