C# Class Aqueduct.Diagnostics.AppLogger

Logs errors and messages using specified configuration. Cannot be inherited.
ファイルを表示 Open project: aqueduct/Aqueduct.SitecoreLib

Public Methods

Method Description
AddGlobalCustomParameter ( string name, string value ) : void
GetNamedLogger ( Type loggedType ) : ILogger

Returns a new instance of ILogger with a name taken from a type

Need to have called Initialise before you can get a working logger

GetNamedLogger ( string logName ) : ILogger

Returns a new instance of ILogger with a given name

Need to have called Initialise before you can get a working logger

Initialise ( string configFilePath, string loggerName ) : void

Initialises AppLogger using the specified config file.

InitialiseFromConfig ( string loggerName ) : void

Initialises AppLogger using the Aqueduct.Config file.

Uses the contents of the Diagnostics.Config setting to Initialise the loggerTo enable the intrelnal log debugging set Diagnostics.InternalDebugMode setting to true

LogDebugMessage ( string message ) : void

Writes DEBUG-level message to the configured log.

LogError ( string message, Exception exception ) : void

Writes ERROR-level message to the configured log.

LogFatalError ( string message, Exception exception ) : void

Writes FATAL-level message to the configured log.

LogInfoMessage ( string message ) : void

Writes INFO-level message to the configured log.

LogWarningMessage ( string message ) : void

Writes WARNING-level message to the configured log.

Private Methods

Method Description
SendToAppFail ( Exception exception ) : void

Method Details

AddGlobalCustomParameter() public static method

public static AddGlobalCustomParameter ( string name, string value ) : void
name string
value string
return void

GetNamedLogger() public static method

Returns a new instance of ILogger with a name taken from a type
Need to have called Initialise before you can get a working logger
public static GetNamedLogger ( Type loggedType ) : ILogger
loggedType System.Type The type which will be used as the logger's name.
return ILogger

GetNamedLogger() public static method

Returns a new instance of ILogger with a given name
Need to have called Initialise before you can get a working logger
public static GetNamedLogger ( string logName ) : ILogger
logName string Name of the logger to use for logging.
return ILogger

Initialise() public static method

Initialises AppLogger using the specified config file.
when is null or empty. when is null or empty.
public static Initialise ( string configFilePath, string loggerName ) : void
configFilePath string Name of the config file to load configuration from.
loggerName string Name of the logger to use for logging.
return void

InitialiseFromConfig() public static method

Initialises AppLogger using the Aqueduct.Config file.
Uses the contents of the Diagnostics.Config setting to Initialise the logger To enable the intrelnal log debugging set Diagnostics.InternalDebugMode setting to true
public static InitialiseFromConfig ( string loggerName ) : void
loggerName string
return void

LogDebugMessage() public static method

Writes DEBUG-level message to the configured log.
public static LogDebugMessage ( string message ) : void
message string The message to log.
return void

LogError() public static method

Writes ERROR-level message to the configured log.
public static LogError ( string message, Exception exception ) : void
message string The message to log.
exception System.Exception The exception to log.
return void

LogFatalError() public static method

Writes FATAL-level message to the configured log.
public static LogFatalError ( string message, Exception exception ) : void
message string The message to log.
exception System.Exception The exception to log.
return void

LogInfoMessage() public static method

Writes INFO-level message to the configured log.
public static LogInfoMessage ( string message ) : void
message string The message to log.
return void

LogWarningMessage() public static method

Writes WARNING-level message to the configured log.
public static LogWarningMessage ( string message ) : void
message string The message to log.
return void