You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicko Cadell <ni...@neoworks.com> on 2006/03/03 16:08:10 UTC
RE: ADO.NET Appender and connection pooling
There is an example, in the log4net source repository, of a simple
database appender that uses connection pooling and performs better in
multithreaded applications. I think that an earlier version of this
appender was included in the last release in the
examples/net/1.0/Appenders/SampleAppendersApp/cs/src/Appender folder.
The latest version of the source can be found here:
http://svn.apache.org/viewcvs.cgi/logging/log4net/trunk/examples/net/1.0
/Appenders/SampleAppendersApp/cs/src/Appender/FastDbAppender.cs?view=mar
kup
This appender is designed to work with a fixed database schema, the
schema cannot be configured via the config file. This makes the appender
implementation simple and also reduces the complexity of the
configuration file.
Typically you would want to subclass the appender to override the
methods that are schema specific.
Cheers,
Nicko
> -----Original Message-----
> From: Simon Wallis [mailto:mailing@wallis.ca]
> Sent: 02 February 2006 15:25
> To: Log4NET User
> Subject: ADO.NET Appender and connection pooling
>
> Hi,
>
> It seems that the ADO.NET appender only ever uses one
> connection to the database. It opens this connection when the
> config file is parsed, and keeps it open for the duration of its life.
>
> Does anyone see any problems with this being a bottleneck? I
> searched in the archives and can't find anyone else ever
> bringing this up. I just wonder if this is a problem under
> heavy load, because aren't you single-threading access to the
> database? Logging calls to the ADO.NET Appender are synchronous too.
>
> Does anyone have thoughts on this?
>
> Simon.
>