You can iterate through the appenders and locate your file appender (or
RollingFileAppender) like this:
foreach(log4net.Appender.IAppender appender in
log4net.LogManager.GetRepository().GetAppenders())
{
if (appender is log4net.Appender.FileAppender)
{
log4net.Appender.FileAppender fileAppender =
(log4net.Appender.FileAppender)appender;
// Get value of properties
string filePath = fileAppender.File;
}
}
Cheers,
Nicko
> -----Original Message-----
> From: Russell Haley [mailto:[EMAIL PROTECTED]
> Sent: 06 August 2005 00:23
> To: Log4NET User
> Subject: Appenders current file path?
>
> Is there a way of getting the current filename (preferably
> the whole path) of a rolling file appender? I'm using a file
> appender that rolls on date and creates specific paths for
> each month and year and I'd like to have my application bring
> up the current log file in notepad without having the user
> look for it.
>
> Cheers!
> Russ
>
>
>