If you want each application to have a separate log4net configuration
then each application should load the log4net configuration (either
programmatically or using attributes) the shared library should not try
configure log4net at all.

I.e. however you are loading "mydll.dll.log4net", don't. Just add the
configuration code to the application entry point assembly.

Nicko

> -----Original Message-----
> From: yofnik [mailto:[EMAIL PROTECTED] 
> Sent: 19 July 2005 19:41
> To: [email protected]
> Subject: shared library
> 
> Hello everyone,
> I have developed collection of tools that all share a common 
> .NET library that I have developed. The DLL uses log4net with 
> the RollingFileAppender. I use Nant to build all the tools 
> and copy all the executables to a "bin"
> directory. 
> 
> Now here's my problem, because the shared dll uses log4net, 
> every application tries to open the same log file. I end up 
> getting errors saying the log file is locked by another process. 
> 
> I know I can set the LockingModel to MinimalLock, but this 
> will affect performance significantly, won't it? 
> 
> I would really like to specify a different appender (log 
> file) for each executable. So instead of having 
> "mydll.dll.log4net", I would like to use "myapp1.exe.log4net" 
> or "myapp2.exe.log4net" for each application. How can this be 
> accomplished? 
> 
> Your help is greatly appreciated.
> 
> Jeff
> 
> 
> 

Reply via email to