Could you post your <appender> node for us. What database are you
logging to? 

According the documentation for 1.2.9 beta, there is a property called
bufferSize which writes statements to the database in batches:

 <bufferSize value="100" />

A similiar property exists in 1.2.0 beta 8.

Its very common to declare your loggers like this:

private static readonly log4net.ILog log =
log4net.LogManager.GetLogger(
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType );

I don't think creating a new instance of a logger for each request is
the most efficient way to do things.

--- [EMAIL PROTECTED] wrote:

> Hi,
> 
> I'm using log4net in an asp.net application to log page hits to a
> database.  It's working really well, however, whilst recently doing
> some
> performance testing of 200+ clients I discovered that I was blocking
> which was seriously hitting my performance (halving the number of
> requests per second).  The block was in the lock in
> AppenderSkeleton.DoAppend.  It would appear that all of my asp.net
> requests are coming and hitting using the same instance of the logger
> which ultimately ends up waiting for the appenders to run through. 
> What
> is happening is that I'm creating a choke point around my database
> calls
> which is seriously costing me.
> 
> I'm creating the logger in the standard fashion in a HTTP Module
> (although not into a static instance), although if I understand the
> code
> correctly I would always end up with the same logger objects as the
> wrappermap in the logmanager is static.  
> 
> My question is; is there anyway of getting the logmanager to create
> me a
> new instance of my loggers?  Or of not sharing the loggers with every
> other thread in the appdomain?  I'm using quite an old version of
> log4net (1.2.0 beta8), however, I can't see any massive difference in
> the way the logmanager works in the latest version - however, if the
> answer is, go and try the latest version then this is something I'll
> have to think about :).
> 
> Alternatively, have I done something really daft in the way I've
> instantiated this?  Is there something in the config which would
> solve
> my problem?
> 
> Any help gratefully received.
> 
> Cheers,
> 
> Darren
> 
> -- 
> 
>
------------------------------------------------------------------------------
> Halifax plc, Registered in England No. 2367076.  Registered Office:
> Trinity Road, Halifax, West Yorkshire HX1 2RG. Authorised and
> regulated by the Financial Services Authority.  Represents only the
> Halifax Financial Services Marketing Group for the purposes of
> advising on and selling life assurance, pensions and collective
> investment scheme business.  
>
==============================================================================
> 

Reply via email to