Class SerilogLogger
Implements MS ILogger on top of Serilog.
Inheritance
System.Object
Assembly: cs.temp.dll.dll
Syntax
public class SerilogLogger : IDisposable
Constructors
SerilogLogger(LoggerConfiguration)
Declaration
public SerilogLogger(LoggerConfiguration logConfig)
Parameters
Type |
Name |
Description |
LoggerConfiguration |
logConfig |
|
Properties
SerilogLog
Declaration
public Serilog.ILogger SerilogLog { get; }
Property Value
Type |
Description |
Serilog.ILogger |
|
Methods
CreateWithDefaultConfiguration(IHostingEnvironment, ILoggingConfiguration, IConfiguration)
Declaration
public static SerilogLogger CreateWithDefaultConfiguration(IHostingEnvironment hostingEnvironment, ILoggingConfiguration loggingConfiguration, IConfiguration configuration)
Parameters
Type |
Name |
Description |
IHostingEnvironment |
hostingEnvironment |
|
ILoggingConfiguration |
loggingConfiguration |
|
IConfiguration |
configuration |
|
Returns
CreateWithDefaultConfiguration(IHostingEnvironment, ILoggingConfiguration, IConfiguration, out UmbracoFileConfiguration)
Creates a logger with some pre-defined configuration and remainder from config file
Declaration
public static SerilogLogger CreateWithDefaultConfiguration(IHostingEnvironment hostingEnvironment, ILoggingConfiguration loggingConfiguration, IConfiguration configuration, out UmbracoFileConfiguration umbracoFileConfig)
Parameters
Type |
Name |
Description |
IHostingEnvironment |
hostingEnvironment |
|
ILoggingConfiguration |
loggingConfiguration |
|
IConfiguration |
configuration |
|
UmbracoFileConfiguration |
umbracoFileConfig |
|
Returns
Debug(Type, String)
Declaration
public void Debug(Type reporting, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
Debug(Type, String, Object[])
Declaration
public void Debug(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Dispose()
Declaration
Error(Type, Exception)
Declaration
public void Error(Type reporting, Exception exception)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
Error(Type, Exception, String)
Declaration
public void Error(Type reporting, Exception exception, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
System.String |
message |
|
Error(Type, Exception, String, Object[])
Declaration
public void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Error(Type, String)
Declaration
public void Error(Type reporting, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
Error(Type, String, Object[])
Declaration
public void Error(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Fatal(Type, Exception)
Declaration
public void Fatal(Type reporting, Exception exception)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
Fatal(Type, Exception, String)
Declaration
public void Fatal(Type reporting, Exception exception, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
System.String |
message |
|
Fatal(Type, Exception, String, Object[])
Declaration
public void Fatal(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Fatal(Type, String)
Declaration
public void Fatal(Type reporting, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
Fatal(Type, String, Object[])
Declaration
public void Fatal(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Info(Type, String)
Declaration
public void Info(Type reporting, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
Info(Type, String, Object[])
Declaration
public void Info(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
IsEnabled(Type, LogLevel)
Declaration
public bool IsEnabled(Type reporting, LogLevel level)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.LogLevel |
level |
|
Returns
Type |
Description |
System.Boolean |
|
Verbose(Type, String)
Declaration
public void Verbose(Type reporting, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
Verbose(Type, String, Object[])
Declaration
public void Verbose(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Warn(Type, Exception, String)
Declaration
public void Warn(Type reporting, Exception exception, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
System.String |
message |
|
Warn(Type, Exception, String, Object[])
Declaration
public void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.Exception |
exception |
|
System.String |
messageTemplate |
|
System.Object[] |
propertyValues |
|
Warn(Type, String)
Declaration
public void Warn(Type reporting, string message)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
Warn(Type, String, Object[])
Declaration
public void Warn(Type reporting, string message, params object[] propertyValues)
Parameters
Type |
Name |
Description |
System.Type |
reporting |
|
System.String |
message |
|
System.Object[] |
propertyValues |
|