<?xml version="1.0"?>
<doc>
<assembly>
<name>log4net</name>
</assembly>
<members>
<member name="T:log4net.Appender.AdoNetAppender">
<summary>
Appender that logs to a database.
</summary>
<remarks>
<para>
<see cref="T:log4net.Appender.AdoNetAppender"/> appends logging events to a table within a
database. The appender can be configured to specify the connection
string by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionString"/> property.
The connection type (provider) can be specified by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/>
property. For more information on database connection strings for
your specific database see <a href="http://www.connectionstrings.com/">http://www.connectionstrings.com/</a>.
</para>
<para>
Records are written into the database either using a prepared
statement or a stored procedure. The <see cref="P:log4net.Appender.AdoNetAppender.CommandType"/> property
is set to <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify a prepared statement
or to <see cref="F:System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify a stored
procedure.
</para>
<para>
The prepared statement text or the name of the stored procedure
must be set in the <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> property.
</para>
<para>
The prepared statement or stored procedure can take a number
of parameters. Parameters are added using the <see cref="M:log4net.Appender.AdoNetAppender.AddParameter(log4net.Appender.AdoNetAppenderParameter)"/>
method. This adds a single <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> to the
ordered list of parameters. The <see cref="T:log4net.Appender.AdoNetAppenderParameter"/>
type may be subclassed if required to provide database specific
functionality. The <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> specifies
the parameter name, database type, size, and how the value should
be generated using a <see cref="T:log4net.Layout.ILayout"/>.
</para>
</remarks>
<example>
An example of a SQL Server table that could be logged to:
<code lang="SQL">
CREATE TABLE [dbo].[Log] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Date] [datetime] NOT NULL ,
[Thread] [varchar] (255) NOT NULL ,
[Level] [varchar] (20) NOT NULL ,
[Logger] [varchar] (255) NOT NULL ,
[Message] [varchar] (4000) NOT NULL
) ON [PRIMARY]
</code>
</example>
<example>
An example configuration to log to the above table:
<code lang="XML" escaped="true">
<appender name="AdoNetAppender_SqlServer" type="log4net.Appender.AdoNetAppender">
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<connectionString value="data source=SQLSVR;initial catalog=test_log4net;integrated security=false;persist security info=True;User ID=sa;Password=sa"/>
<commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message]) VALUES (@log_date, @thread, @log_level, @logger, @message)"/>
<parameter>
<parameterName value="@log_date"/>
<dbType value="DateTime"/>
<layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}"/>
</parameter>
<parameter>
<parameterName value="@thread"/>
<dbType value="String"/>
<size value="255"/>
<layout type="log4net.Layout.PatternLayout" value="%thread"/>
</parameter>
<parameter>
<parameterName value="@log_level"/>
<dbType value="String"/>
<size value="50"/>
<layout type="log4net.Layout.PatternLayout" value="%level"/>
</parameter>
<parameter>
<parameterName value="@logger"/>
<dbType value="String"/>
<size value="255"/>
<layout type="log4net.Layout.PatternLayout" value="%logger"/>
</parameter>
<parameter>
<parameterName value="@message"/>
<dbType value="String"/>
<size value="4000"/>
<layout type="log4net.Layout.PatternLayout" value="%message"/>
</parameter>
</appender>
</code>
</example>
<author>Julian Biddle</author>
<author>Nicko Cadell</author>
<author>Gert Driesen</author>
<author>Lance Nehring</author>
</member>
<member name="T:log4net.Appender.BufferingAppenderSkeleton">
<summary>
Abstract base class implementation of <see cref="T:log4net.Appender.IAppender"/> that
buffers events in a fixed size buffer.
</summary>
<remarks>
<para>
This base class should be used by appenders that need to buffer a
number of events before logging them. For example the <see cref="T:log4net.Appender.AdoNetAppender"/>
buffers events and then submits the entire contents of the buffer to
the underlying database in one go.
</para>
<para>
Subclasses should override the <see cref="M:SendBuffer(LoggingEvent[])"/>
method to deliver the buffered events.
</para>
<para>The BufferingAppenderSkeleton maintains a fixed size cyclic
buffer of events. The size of the buffer is set using
the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> property.
</para>
<para>A <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> is used to inspect
each event as it arrives in the appender. If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/>
triggers, then the current buffer is sent immediately
(see <see cref="M:SendBuffer(LoggingEvent[])"/>). Otherwise the event
is stored in the buffer. For example, an evaluator can be used to
deliver the events immediately when an ERROR event arrives.
</para>
<para>
The buffering appender can be configured in a <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode.
By default the appender is NOT lossy. When the buffer is full all
the buffered events are sent with <see cref="M:SendBuffer(LoggingEvent[])"/>.
If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> property is set to <c>true</c> then the
buffer will not be sent when it is full, and new events arriving
in the appender will overwrite the oldest event in the buffer.
In lossy mode the buffer will only be sent when the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/>
triggers. This can be useful behavior when you need to know about
ERROR events but not about events with a lower level, configure an
evaluator that will trigger when an