BasicConfigurator does not call activeOptions() on
added appenders, therefore RollingFileAppender does
not work as expected with regard to pre-existing log
files. When configured from a config file,
DomConfigurator does call activeOptions() and
RollingFileAppender works as expected (that is,
initializes itself by scanning the hard drive for files
matching the log naming filespec within the defined
number range for backup versions). If one calls
activeOptions() in code after adding the appender in
code, it also works as expected.
Shouldn't BasicConfigurator call activeOptions() on its
added appenders? Or is this by design?
Thanks for considering this.
Logged In: NO
That is, activateOptions().
Logged In: YES
user_id=278872
The current design requires you to call ActivateOptions() on
the appender (if it supports it) when adding appenders
programatically.
Logged In: NO
Thank you very much for considering this topic.
It was not apparent from the documentation I have found so
far that ActivateOptions() needed to be called when
programatically adding appenders.
Logged In: YES
user_id=278872
I will update the documentation for IAppender to include this
information in the next release.
Thanks,
Nicko
Logged In: NO
Thanks very much!
I am sure that documentation and example code for using
ActivateOptions() with the BasicConfigurator will be very
helpful. Great tool. It's nice to see the open-source process
at work.