C# 클래스 SampleApplication.Log4NetConfiguration

파일 보기 프로젝트 열기: ChrisEdwards/Fluency

공개 메소드들

메소드 설명
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.

메소드 상세

AddAppender() 공개 정적인 메소드

Add an appender to a logger.
public static AddAppender ( string loggerName, IAppender appender ) : void
loggerName string Name of the logger.
appender IAppender The appender.
리턴 void

Configure() 공개 정적인 메소드

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.
public static Configure ( ) : void
리턴 void

CreateFileAppender() 공개 정적인 메소드

Create a new file appender.
public static CreateFileAppender ( string name, string fileName ) : IAppender
name string The name.
fileName string Name of the file.
리턴 IAppender

FindAppender() 공개 정적인 메소드

Find a named appender already attached to a logger.
public static FindAppender ( string appenderName ) : IAppender
appenderName string Name of the appender.
리턴 IAppender

SetLevel() 공개 정적인 메소드

Set the level for a named logger.
public static SetLevel ( string loggerName, string levelName ) : void
loggerName string Name of the logger.
levelName string Name of the level.
리턴 void