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 Graham Walsh <gr...@calyon.com> on 2008/08/20 12:38:51 UTC

domains and log4net

Hi,

 

This is driving me CRAZY! :( I'm doing something I see others a trying
to do (via google) however I simply cannot get it to work.

 

I have a GUI app that uses a rollingFileAppender (it also uses a
RichTextBox appender but  for the moment, I just want the file appender
to work ok). Anyways, I create my Domain and point everything to the
"previousVersion" directory where all the dlls are located for the new
Domain. I successfully call my methods in the new domain.

 

AppDomain newDomain = AppDomain.CreateDomain("NewDomain", null,
"previousVersion", ".", false, null, null);

 

I make calls using this newDomain and everything works fine. I cannot
however get the logger to log to the parent domains logfile. i.e. both
domains should log to toto.log but they don't. The new domain logs
nothing. I can't even get the new domain to log to a separate logfile,
so I know I'm doing something dumb

 

I have tried adding 

 

<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

<lockingModel type="log4net.Appender.RichTextBoxAppender+MinimalLock" />

to my appenders but without any luck. I am sure I'm doing something
really stupid here but I just can't see what.  the log4net config file
is correctly locatedd in the new domains working directory and
permissions are fine. Is there a way to debug log4net to see what I'm
doing wrong?

 

thanks much for any help

G