[ 
http://issues.apache.org/jira/browse/LOG4NET-48?page=comments#action_12320610 ] 

Nicko Cadell commented on LOG4NET-48:
-------------------------------------

 
> Process A starts process B using the 
> System.Diagnostics.Process.Start() method.  

These 2 processes are therefore completely independent. Each will have its own 
logging configuration.


> Process B use [assembly: 
> log4net.Config.XmlConfigurator(Watch=true)] to auto configure 
> its log4net environment.

This is asking log4net (in process B) to look for process B's .config file.


> Log4net didn't succeed to initialyze itself properly.

In which process?


> Looks like it didn't find process A's config file.

In process A or B? Why would log4net in process B try to find process A's 
config file?

> 
> Work around. Process B initialyze log4net manualy:
> > 
> >             string codeBase =
> > System.Reflection.Assembly.GetEntryAssembly().CodeBase;
> >             Uri uri = new Uri(codeBase + ".config");
> >             log4net.Config.XmlConfigurator.Configure(new
> > FileInfo(uri.LocalPath));

Do you have the output of running with log4net internal debug enabled?
http://logging.apache.org/log4net/release/faq.html#internalDebug

So far this sounds much more like a user query than a bug.
Please post any follow up queries and info to the log4net-user mailing list.
http://logging.apache.org/log4net/support.html

Cheers.

> Executed processes cannot auto find their app.config file
> ---------------------------------------------------------
>
>          Key: LOG4NET-48
>          URL: http://issues.apache.org/jira/browse/LOG4NET-48
>      Project: Log4net
>         Type: Bug
>   Components: Core
>     Versions: 1.2.9
>     Reporter: Nicolas Roy
>     Priority: Minor

>
> Process A starts process B using the System.Diagnostics.Process.Start() 
> method.  
> Process B use [assembly: log4net.Config.XmlConfigurator(Watch=true)] to auto 
> configure its log4net environment.
> Log4net didn't succeed to initialyze itself properly.  Looks like it didn't 
> find process A's config file.
> Work around. Process B initialyze log4net manualy:
> > 
> >             string codeBase =
> > System.Reflection.Assembly.GetEntryAssembly().CodeBase;
> >             Uri uri = new Uri(codeBase + ".config");
> >             log4net.Config.XmlConfigurator.Configure(new
> > FileInfo(uri.LocalPath));

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to