You can get a list of appenders by calling GetAppenders: IAppender[] appenders = LogManager.GetRepository().GetAppenders();
If you need to modifiy an appender at run-time, you should be able to find the appender using the above code, modify the appender, then call ActivateOptions to re-initialize it. The FileAppender automatically creates the directory structure if it does not exist (lines 400 and 533 of FileAppender.cs are calls to Directory.CreateDirectory(string)). --- Gary Hinger <[EMAIL PROTECTED]> wrote: > Is there a way to extract elements from log4net's XML configuration > file, without reopening the file and parsing it? > > > > For example, I'd like to get a certain appender's "file" property, so > that I can create the logging directory every time logging is done. I > need to do this to support runtime changes in the directory > specification in config xml. Since the log4net assembly is designed > to > watch the file, it would be a shame to have to reparse the file in > separate code. > > > > Also, is there a way to get log4net to create directories as > necessary > when logging? This would solve my immediate problem. Thanks. > > > >
