C# 클래스 SampleAppendersApp.Appender.FastDbAppender

Simple database appender

This database appender is very simple and does not support a configurable data schema. The schema supported is hardcoded into the appender. Also by not extending the AppenderSkeleton base class this appender avoids the serializable locking that it enforces.

This appender can be subclassed to change the database connection type, or the database schema supported.

To change the database connection type the GetConnection method must be overridden.

To change the database schema supported by the appender the InitializeCommand and SetCommandValues methods must be overridden.

상속: IAppender, IBulkAppender, IOptionHandler
파일 보기 프로젝트 열기: aurora-sim/Aurora-Libs

공개 메소드들

메소드 설명
ActivateOptions ( ) : void
Close ( ) : void
DoAppend ( log4net.Core.LoggingEvent loggingEvent ) : void

보호된 메소드들

메소드 설명
GetConnection ( ) : IDbConnection

Create the connection object

This implementation returns a SqlConnection. To change the connection subclass this appender and return a different connection type.

InitializeCommand ( IDbCommand command ) : void

Initialize the command object supplied

This method must setup the database command and the parameters.

SetCommandValues ( IDbCommand command, log4net.Core.LoggingEvent loggingEvent ) : void

Set the values for the command parameters

Set the values of the parameters created by the InitializeCommand method.

메소드 상세

ActivateOptions() 공개 메소드

public ActivateOptions ( ) : void
리턴 void

Close() 공개 메소드

public Close ( ) : void
리턴 void

DoAppend() 공개 메소드

public DoAppend ( log4net.Core.LoggingEvent loggingEvent ) : void
loggingEvent log4net.Core.LoggingEvent
리턴 void

GetConnection() 보호된 메소드

Create the connection object

This implementation returns a SqlConnection. To change the connection subclass this appender and return a different connection type.

protected GetConnection ( ) : IDbConnection
리턴 IDbConnection

InitializeCommand() 보호된 메소드

Initialize the command object supplied

This method must setup the database command and the parameters.

protected InitializeCommand ( IDbCommand command ) : void
command IDbCommand the command to initialize
리턴 void

SetCommandValues() 보호된 메소드

Set the values for the command parameters

Set the values of the parameters created by the InitializeCommand method.

protected SetCommandValues ( IDbCommand command, log4net.Core.LoggingEvent loggingEvent ) : void
command IDbCommand the command to update
loggingEvent log4net.Core.LoggingEvent the current logging event to retrieve the values from
리턴 void