If you need to log to a different database for each log event then you
will need to customised the ADONetAppender. If you are using ASP.NET
then your appender may be able to work out the database to use from the
http context.

The ADONetAppender also buffers events before logging them to the
database. You will either need to disable/remove the buffering or to
have a separate buffer for each database.

Nicko 

> -----Original Message-----
> From: Przemyslaw Skrzek [mailto:[EMAIL PROTECTED] 
> Sent: 20 August 2004 10:22
> To: [email protected]
> Subject: Multi-database appender
> 
> Dear All,
> 
> We are considering using log4net as logging services for 
> ASP.Net internet application, that works with multiple MSSQL 
> databases. Basically, user can work with different databases 
> and we need to log events into these databases separatelly as 
> well. Our obvious choice was ADONetAppender, but here we 
> faced the following problem:
> 
> It looks like log4net framework is configured 'once at in a 
> lifietime', basing on configuration file. Ok, it is great - 
> works perfect with statically defined ADONetAppender - we 
> just specify server, db, etc. But, how to handle a situation, 
> when with every Request to ASP.Net application we need to log 
> into different database (I mean - we have multiple users 
> using different databases)? Reconfigureing log4net framework 
> each time seems to be not a good idea ;-(. Is it possible to 
> force somehow the appender to select database basing on 
> information send from a client in runtime?
> 
> Regards,
> Przemek Skrzek, Poland
> 
> PS: I am using log4net 1.2.0beta + .Net framework 1.1
> 
> 

Reply via email to