Interface ILogger
Defines the logging service.
Namespace: Umbraco.Core.Logging
Assembly: Umbraco.Core.dll
Syntax
public interface ILogger
Remarks
Message templates in logging methods follow the Message Templates specification available at https://messagetemplates.org/ in order to support structured logging.
Implementations must ensure that they support these templates. Note that the specification includes support for traditional C# numeric placeholders.
For instance, "Processed {Input} in {Time}ms."
Methods
View SourceDebug(Type, String)
Logs a debugging message.
Declaration
void Debug(Type reporting, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | message | A message. |
Debug(Type, String, Object[])
Logs a debug message.
Declaration
void Debug(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Error(Type, Exception)
Logs an error exception.
Declaration
void Error(Type reporting, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
Remarks
The message string is unspecified and is implementation-specific.
Error(Type, Exception, String)
Logs an error message with an exception.
Declaration
void Error(Type reporting, Exception exception, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
System.String | message | A message. |
Error(Type, Exception, String, Object[])
Logs an error message with an exception.
Declaration
void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Error(Type, String)
Logs an error message.
Declaration
void Error(Type reporting, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | message | A message. |
Error(Type, String, Object[])
Logs an error message.
Declaration
void Error(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Fatal(Type, Exception)
Logs a fatal exception.
Declaration
void Fatal(Type reporting, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
Remarks
The message string is unspecified and is implementation-specific.
Fatal(Type, Exception, String)
Logs a fatal message with an exception.
Declaration
void Fatal(Type reporting, Exception exception, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
System.String | message | A message. |
Fatal(Type, Exception, String, Object[])
Logs a fatal message with an exception.
Declaration
void Fatal(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Fatal(Type, String)
Logs a fatal message.
Declaration
void Fatal(Type reporting, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | message | A message. |
Fatal(Type, String, Object[])
Logs a fatal message.
Declaration
void Fatal(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Info(Type, String)
Logs an information message.
Declaration
void Info(Type reporting, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | message | A message. |
Info(Type, String, Object[])
Logs a info message.
Declaration
void Info(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
IsEnabled(Type, LogLevel)
Determines if logging is enabled at a specified level, for a reporting type.
Declaration
bool IsEnabled(Type reporting, LogLevel level)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
LogLevel | level | The level. |
Returns
Type | Description |
---|---|
System.Boolean |
Verbose(Type, String)
Logs a verbose message.
Declaration
void Verbose(Type reporting, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | message | A message. |
Verbose(Type, String, Object[])
Logs a verbose message.
Declaration
void Verbose(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Warn(Type, Exception, String)
Logs a warning message with an exception.
Declaration
void Warn(Type reporting, Exception exception, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
System.String | message | A message. |
Warn(Type, Exception, String, Object[])
Logs a warning message with an exception.
Declaration
void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.Exception | exception | An exception. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Warn(Type, String)
Logs a warning message.
Declaration
void Warn(Type reporting, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | message | A message. |
Warn(Type, String, Object[])
Logs a warning message.
Declaration
void Warn(Type reporting, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
System.Type | reporting | The reporting type. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |