Marco, 

> I don't know if the subject makes really clear what I want.
> I want to configure log4net only once, usually this way:
> 
> this.log= LogManager.GetLogger(typeof(MyClass));                      
> log4net.Config.DOMConfigurator.Configure(new
> System.IO.FileInfo("log4net.xml"));
> 
> Now I want to log from other classes too, without 
> reconfiguring the Logger. 

Just get a logger for each class and log into it. You only need to
configure log4net once, all the ILog instances will log to the same
configured repository.

I tend to create my log instance statically for a class as it never
changes:

#region Logging Definition
private static readonly log4net.ILog log =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMeth
od().DeclaringType);
#endregion

Just add that to each class.

Cheers,
Nicko

Reply via email to