C# Class 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.

Inheritance: IAppender, IBulkAppender, IOptionHandler
Afficher le fichier Open project: aurora-sim/Aurora-Libs

Méthodes publiques

Méthode Description
ActivateOptions ( ) : void
Close ( ) : void
DoAppend ( log4net.Core.LoggingEvent loggingEvent ) : void

Méthodes protégées

Méthode Description
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.

Method Details

ActivateOptions() public méthode

public ActivateOptions ( ) : void
Résultat void

Close() public méthode

public Close ( ) : void
Résultat void

DoAppend() public méthode

public DoAppend ( log4net.Core.LoggingEvent loggingEvent ) : void
loggingEvent log4net.Core.LoggingEvent
Résultat void

GetConnection() protected méthode

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
Résultat IDbConnection

InitializeCommand() protected méthode

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
Résultat void

SetCommandValues() protected méthode

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
Résultat void