Méthode | Description | |
---|---|---|
AddAppender ( string loggerName, IAppender appender ) : void |
Add an appender to a logger.
|
|
Configure ( ) : void |
Configures Log4Net to write to the file C:\Application.log After configuring, for each class you want to log from, add the following property to it: private static readonly ILog log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType ); Then to call the log, you can use: log.Debug( "your message to log" ); There are messages other than debug that you can use. Debug should only be used for debugging info. Use the correct message level for each log message.
|
|
CreateFileAppender ( string name, string fileName ) : IAppender |
Create a new file appender.
|
|
FindAppender ( string appenderName ) : IAppender |
Find a named appender already attached to a logger.
|
|
SetLevel ( string loggerName, string levelName ) : void |
Set the level for a named logger.
|
public static AddAppender ( string loggerName, IAppender appender ) : void | ||
loggerName | string | Name of the logger. |
appender | IAppender | The appender. |
Résultat | void |
public static CreateFileAppender ( string name, string fileName ) : IAppender | ||
name | string | The name. |
fileName | string | Name of the file. |
Résultat | IAppender |
public static FindAppender ( string appenderName ) : IAppender | ||
appenderName | string | Name of the appender. |
Résultat | IAppender |
public static SetLevel ( string loggerName, string levelName ) : void | ||
loggerName | string | Name of the logger. |
levelName | string | Name of the level. |
Résultat | void |