Class DnnLogger
Please use LoggerSource.Instance as a more unit testable way to create loggers.
Inheritance
Namespace: DotNetNuke.Instrumentation
Assembly: DotNetNuke.Instrumentation.dll
Syntax
public sealed class DnnLogger : LoggerWrapperImpl
Methods
| Improve this Doc View SourceDebug(Object)
Logs a message object with the DEBUG level.
Declaration
public void Debug(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
Remarks
This method first checks if this logger is DEBUG
enabled by comparing the level of this logger with the
DEBUG level. If this logger is
DEBUG enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
WARNING Note that passing an
DebugFormat(IFormatProvider, String, Object[])
Logs a formatted message string with the DEBUG level.
Declaration
public void DebugFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An |
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an
DebugFormat(String, Object[])
Logs a formatted message string with the DEBUG level.
Declaration
public void DebugFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
The string is formatted using the
This method does not take an
Error(Object, Exception)
Logs a message object with the ERROR level.
Declaration
public void Error(object message, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
| Exception | exception | The exception to log, including its stack trace. |
Remarks
Logs a message object with the ERROR level including
the stack trace of the exception
passed as a parameter.
See the Error(Object) form for more detailed information.
See Also
| Improve this Doc View SourceError(Object)
Logs a message object with the ERROR level.
Declaration
public void Error(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
Remarks
This method first checks if this logger is ERROR
enabled by comparing the level of this logger with the
ERROR level. If this logger is
ERROR enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
WARNING Note that passing an
ErrorFormat(IFormatProvider, String, Object[])
Logs a formatted message string with the ERROR level.
Declaration
public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An |
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an
ErrorFormat(String, Object[])
Logs a formatted message string with the ERROR level.
Declaration
public void ErrorFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
The string is formatted using the
This method does not take an
Fatal(Object, Exception)
Logs a message object with the FATAL level.
Declaration
public void Fatal(object message, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
| Exception | exception | The exception to log, including its stack trace. |
Remarks
Logs a message object with the FATAL level including
the stack trace of the exception
passed as a parameter.
See the Fatal(Object) form for more detailed information.
See Also
| Improve this Doc View SourceFatal(Object)
Logs a message object with the FATAL level.
Declaration
public void Fatal(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
Remarks
This method first checks if this logger is FATAL
enabled by comparing the level of this logger with the
FATAL level. If this logger is
FATAL enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
WARNING Note that passing an
FatalFormat(IFormatProvider, String, Object[])
Logs a formatted message string with the FATAL level.
Declaration
public void FatalFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An |
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an
FatalFormat(String, Object[])
Logs a formatted message string with the FATAL level.
Declaration
public void FatalFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
The string is formatted using the
This method does not take an
GetClassLogger(Type)
Gets the logger for the given type.
Declaration
public static DnnLogger GetClassLogger(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type for which to get a logger instance. |
Returns
| Type | Description |
|---|---|
| DnnLogger | A new DnnLogger instance. |
GetLogger(String)
Gets the logger for the given name.
Declaration
public static DnnLogger GetLogger(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name for the logger instance. |
Returns
| Type | Description |
|---|---|
| DnnLogger | A new DnnLogger instance. |
Info(Object)
Logs a message object with the INFO level.
Declaration
public void Info(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
Remarks
This method first checks if this logger is INFO
enabled by comparing the level of this logger with the
INFO level. If this logger is
INFO enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
WARNING Note that passing an
InfoFormat(IFormatProvider, String, Object[])
Logs a formatted message string with the INFO level.
Declaration
public void InfoFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An |
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an
InfoFormat(String, Object[])
Logs a formatted message string with the INFO level.
Declaration
public void InfoFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
The string is formatted using the
This method does not take an
InstallLogError(Object)
Logs an install message at the Error log level.
Declaration
public void InstallLogError(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message to log. |
InstallLogError(String, Exception)
Log an install message and exception details at the Error log level.
Declaration
public void InstallLogError(string message, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | An object to display as the message. |
| Exception | exception | An exception to include in the log. |
InstallLogErrorFormat(IFormatProvider, String, Object[])
Log an install message at the Error log level.
Declaration
public void InstallLogErrorFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An object that supplies culture-specific formatting information. |
| System.String | format | |
| System.Object[] | args | An object array that contains zero or more objects to format. |
InstallLogErrorFormat(String, Object[])
Log an install message at the Error log level.
Declaration
public void InstallLogErrorFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | |
| System.Object[] | args | An object array that contains zero or more objects to format. |
InstallLogInfo(Object)
Logs an install message at the Info log level.
Declaration
public void InstallLogInfo(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message to log. |
InstallLogInfoFormat(IFormatProvider, String, Object[])
Log an install message at the Info log level.
Declaration
public void InstallLogInfoFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An object that supplies culture-specific formatting information. |
| System.String | format | |
| System.Object[] | args | An object array that contains zero or more objects to format. |
InstallLogInfoFormat(String, Object[])
Log an install message at the Info log level.
Declaration
public void InstallLogInfoFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | |
| System.Object[] | args | An object array that contains zero or more objects to format. |
Warn(Object, Exception)
Logs a message object with the WARN level.
Declaration
public void Warn(object message, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | The message object to log. |
| Exception | exception | The exception to log, including its stack trace. |
Remarks
Logs a message object with the WARN level including
the stack trace of the exception
passed as a parameter.
See the Warn(Object) form for more detailed information.
See Also
| Improve this Doc View SourceWarn(Object)
Logs a message object with the WARN level.
Declaration
public void Warn(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | message | the message object to log. |
Remarks
This method first checks if this logger is WARN
enabled by comparing the level of this logger with the
WARN level. If this logger is
WARN enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
WARNING Note that passing an
WarnFormat(IFormatProvider, String, Object[])
Logs a formatted message string with the WARN level.
Declaration
public void WarnFormat(IFormatProvider provider, string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An |
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an
WarnFormat(String, Object[])
Logs a formatted message string with the WARN level.
Declaration
public void WarnFormat(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | A String containing zero or more format items. |
| System.Object[] | args | An Object array containing zero or more objects to format. |
Remarks
The message is formatted using the String.Format for details of the syntax of the format string and the behavior
of the formatting.
The string is formatted using the
This method does not take an