Or the log4net-user email list, sorry.

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tom Regan
> Sent: Tuesday, July 12, 2005 9:37 AM
> To: log4j-user@logging.apache.org
> Subject: getting the log4net appenders at runtime
> 
> My root appender writes to a text file.  I need to get the path to the
> text
> file at runtime (the FileAppender.File property).  Is there any way to do
> that?
> 
> For example, this pulls back an empty collection of file appenders.  How
> do I
> get the full one?  I'm doing this after calling
> DomConfigurator.Configure():
> 
> log4net.Repository.Hierarchy.Hierarchy h =
> (log4net.Repository.Hierarchy.Hierarchy)log4net.LogManager.GetLoggerReposi
> tory
> ();
> foreach(log4net.Appender.FileAppender fa in h.Root.Appenders)
> {
>       string s = a.File;
> }
> 
> 
> The log4net.helpers.AppenderAttachedImpl object has an Appenders
> collection.
> But how do I instantiate an AppenderAttachedImpl object so that it pulls
> back
> the Appenders collection for the current log4net configuration?
> 
> For example, if I simply instantiate it like so:
> 
> log4net.helpers.AppenderAttachedImpl = new
> log4net.helpers.AppenderAttachedImpl
> ()
> 
> I also get back an empty collection of appenders.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to