<?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="M:log4net.Appender.AdoNetAppender.#ctor">
<summary>
Initializes a new instance of the <see cref="T:log4net.Appender.AdoNetAppender" /> class.
</summary>
<remarks>
Public default constructor to initialize a new instance of this class.
</remarks>
</member>
<member name="P:log4net.Appender.AdoNetAppender.ConnectionString">
<summary>
Gets or sets the database connection string that is used to connect to
the database.
</summary>
<value>
The database connection string used to connect to the database.
</value>
<remarks>
<para>
The connections string is specific to the connection type.
See <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/> for more information.
</para>
</remarks>
<example>Connection string for MS Access via ODBC:
<code>"DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"</code>
</example>
<example>Another connection string for MS Access via ODBC:
<code>"Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"</code>
</example>
<example>Connection string for MS Access via OLE DB:
<code>"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"</code>
</example>
</member>
<member name="P:log4net.Appender.AdoNetAppender.AppSettingsKey">
<summary>
The appSettings key from App.Config that contains the connection string.
</summary>
</member>
<member name="P:log4net.Appender.AdoNetAppender.ConnectionStringName">
<summary>
The connectionStrings key from App.Config that contains the connection string.
</summary>
<remarks>
This property requires at least .NET 2.0.
</remarks>
</member>
<member name="P:log4net.Appender.AdoNetAppender.ConnectionType">
<summary>
Gets or sets the type name of the <see cref="T:System.Data.IDbConnection"/> connection
that should be created.
</summary>
<value>
The type name of the <see c