Class LoggerExtensions
Provides extension methods for the ILogger interface.
Inheritance
Namespace: Umbraco.Core.Logging
Assembly: Umbraco.Core.dll
Syntax
public static class LoggerExtensions
Methods
View SourceDebug<T>(ILogger, String)
Logs a debugging message.
Declaration
public static void Debug<T>(this ILogger logger, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Debug<T>(ILogger, String, Object[])
Logs a debugging message.
Declaration
public static void Debug<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type |
Error<T>(ILogger, Exception)
Logs an error exception.
Declaration
public static void Error<T>(this ILogger logger, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Error<T>(ILogger, Exception, String)
Logs an error message with an exception.
Declaration
public static void Error<T>(this ILogger logger, Exception exception, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Error<T>(ILogger, Exception, String, Object[])
Logs an error message with an exception.
Declaration
public static void Error<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Error<T>(ILogger, String)
Logs an error message.
Declaration
public static void Error<T>(this ILogger logger, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Error<T>(ILogger, String, Object[])
Logs an error message.
Declaration
public static void Error<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Fatal<T>(ILogger, Exception, String)
Logs a fatal message.
Declaration
public static void Fatal<T>(this ILogger logger, Exception exception, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Fatal<T>(ILogger, Exception, String, Object[])
Logs a fatal message.
Declaration
public static void Fatal<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Info<T>(ILogger, String)
Logs an information message.
Declaration
public static void Info<T>(this ILogger logger, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Info<T>(ILogger, String, Object[])
Logs a information message.
Declaration
public static void Info<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type |
IsEnabled<T>(ILogger, LogLevel)
Determines if logging is enabled at a specified level, for a reporting type.
Declaration
public static bool IsEnabled<T>(this ILogger logger, LogLevel level)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
LogLevel | level | The level. |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Verbose<T>(ILogger, String)
Logs a verbose message.
Declaration
public static void Verbose<T>(this ILogger logger, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Verbose<T>(ILogger, String, Object[])
Logs a verbose message.
Declaration
public static void Verbose<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Warn<T>(ILogger, Exception, String)
Logs a warning message with an exception.
Declaration
public static void Warn<T>(this ILogger logger, Exception exception, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Warn<T>(ILogger, Exception, String, Object[])
Logs a warning message with an exception.
Declaration
public static void Warn<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.Exception | exception | An exception. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Warn<T>(ILogger, String)
Logs a warning message.
Declaration
public static void Warn<T>(this ILogger logger, string message)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | message | A message. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |
Warn<T>(ILogger, String, Object[])
Logs a warning message.
Declaration
public static void Warn<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
System.String | messageTemplate | A message template. |
System.Object[] | propertyValues | Property values. |
Type Parameters
Name | Description |
---|---|
T | The reporting type. |