Class Logger
An ASP net logger.
Inheritance
System.Object
Logger
Implements
Microsoft.Extensions.Logging.ILogger
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Application.AspNetCore.Logging
Assembly: Kephas.Application.AspNetCore.dll
Syntax
public class Logger : ILogger
Constructors
| Improve this Doc View SourceLogger(ILogger)
Initializes a new instance of the Logger class.
Declaration
public Logger(ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
Methods
| Improve this Doc View SourceBeginScope<TState>(TState)
Begins a logical operation scope.
Declaration
public IDisposable BeginScope<TState>(TState state)
Parameters
Type | Name | Description |
---|---|---|
TState | state | The identifier for the scope. |
Returns
Type | Description |
---|---|
System.IDisposable | An IDisposable that ends the logical operation scope on dispose. |
Type Parameters
Name | Description |
---|---|
TState | Type of the state. |
IsEnabled(LogLevel)
Checks if the given logLevel
is enabled.
Declaration
public bool IsEnabled(LogLevel logLevel)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Logging.LogLevel | logLevel | Level to be checked. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Log<TState>(LogLevel, EventId, TState, Exception, Func<TState, Exception, String>)
Writes a log entry.
Declaration
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Logging.LogLevel | logLevel | Entry will be written on this level. |
Microsoft.Extensions.Logging.EventId | eventId | Id of the event. |
TState | state | The entry to be written. Can be also an object. |
System.Exception | exception | The exception related to this entry. |
System.Func<TState, System.Exception, System.String> | formatter | Function to create a |
Type Parameters
Name | Description |
---|---|
TState | Type of the state. |
Implements
Microsoft.Extensions.Logging.ILogger