C# 클래스 NLog.Targets.DatabaseTarget

상속: Target
파일 보기 프로젝트 열기: NLog/NLog 1 사용 예제들

Private Properties

프로퍼티 타입 설명
CloseConnection void
EnsureConnectionOpen void
InitializeTarget void
OpenConnection IDbConnection
RunInstallCommands void
WriteEventToDatabase void

공개 메소드들

메소드 설명
DatabaseTarget ( ) : System

Initializes a new instance of the DatabaseTarget class.

DatabaseTarget ( string name ) : System

Initializes a new instance of the DatabaseTarget class.

Install ( InstallationContext installationContext ) : void

Performs installation which requires administrative permissions.

IsInstalled ( InstallationContext installationContext ) : bool?

Determines whether the item is installed.

Uninstall ( InstallationContext installationContext ) : void

Performs uninstallation which requires administrative permissions.

보호된 메소드들

메소드 설명
BuildConnectionString ( LogEventInfo logEvent ) : string

Build the connectionstring from the properties.

Using ConnectionString at first, and falls back to the properties DBHost, DBUserName, DBPassword and DBDatabase

CloseTarget ( ) : void

Closes the target and releases any unmanaged resources.

Write ( AsyncLogEventInfo logEvents ) : void

Writes an array of logging events to the log target. By default it iterates on all events and passes them to "Write" method. Inheriting classes can use this method to optimize batch writes.

Write ( LogEventInfo logEvent ) : void

Writes the specified logging event to the database. It creates a new database command, prepares parameters for it by calculating layouts and executes the command.

비공개 메소드들

메소드 설명
CloseConnection ( ) : void
EnsureConnectionOpen ( string connectionString ) : void
InitializeTarget ( ) : void
OpenConnection ( string connectionString ) : IDbConnection
RunInstallCommands ( InstallationContext installationContext, IEnumerable commands ) : void
WriteEventToDatabase ( LogEventInfo logEvent ) : void

메소드 상세

BuildConnectionString() 보호된 메소드

Build the connectionstring from the properties.
Using ConnectionString at first, and falls back to the properties DBHost, DBUserName, DBPassword and DBDatabase
protected BuildConnectionString ( LogEventInfo logEvent ) : string
logEvent LogEventInfo Event to render the layout inside the properties.
리턴 string

CloseTarget() 보호된 메소드

Closes the target and releases any unmanaged resources.
protected CloseTarget ( ) : void
리턴 void

DatabaseTarget() 공개 메소드

Initializes a new instance of the DatabaseTarget class.
public DatabaseTarget ( ) : System
리턴 System

DatabaseTarget() 공개 메소드

Initializes a new instance of the DatabaseTarget class.
public DatabaseTarget ( string name ) : System
name string Name of the target.
리턴 System

Install() 공개 메소드

Performs installation which requires administrative permissions.
public Install ( InstallationContext installationContext ) : void
installationContext NLog.Config.InstallationContext The installation context.
리턴 void

IsInstalled() 공개 메소드

Determines whether the item is installed.
public IsInstalled ( InstallationContext installationContext ) : bool?
installationContext NLog.Config.InstallationContext The installation context.
리턴 bool?

Uninstall() 공개 메소드

Performs uninstallation which requires administrative permissions.
public Uninstall ( InstallationContext installationContext ) : void
installationContext NLog.Config.InstallationContext The installation context.
리턴 void

Write() 보호된 메소드

Writes an array of logging events to the log target. By default it iterates on all events and passes them to "Write" method. Inheriting classes can use this method to optimize batch writes.
protected Write ( AsyncLogEventInfo logEvents ) : void
logEvents AsyncLogEventInfo Logging events to be written out.
리턴 void

Write() 보호된 메소드

Writes the specified logging event to the database. It creates a new database command, prepares parameters for it by calculating layouts and executes the command.
protected Write ( LogEventInfo logEvent ) : void
logEvent LogEventInfo The logging event.
리턴 void