<?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
没有合适的资源?快使用搜索试试~ 我知道了~
SuperSocket示例源码,带客户端和服务器端
共871个文件
xml:320个
_:227个
dll:140个
4星 · 超过85%的资源 需积分: 49 332 下载量 117 浏览量
2018-07-05
15:16:59
上传
评论 9
收藏 21.19MB ZIP 举报
温馨提示
这个代码的优点是采用自定义命令行协议以及自定义命令过滤器,执行效率高,可扩展性能强,这都是日常工作敲出来可以正常工作的,欢迎大家下载.有问题请留言!
资源推荐
资源详情
资源评论
收起资源包目录
SuperSocket示例源码,带客户端和服务器端 (871个子文件)
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
共 871 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
xiaobingge2018
- 粉丝: 10
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页