From: <msc...@ao...> - 2002-11-24 03:40:34
|
In a message dated 11/23/2002 7:08:31 PM Eastern Standard Time, Kevin Goess <ke...@go...> writes: >Mike, after further review, if we do something like this: > > sub Log::Log4perl::appender_by_name { > return $Log::Log4perl::Logger::APPENDER_BY_NAME{shift}; > } > >then we might create problems where the user code has a reference to an >appender, then init_and_watch() reloads everything and the user's >reference is no longer connected to anything, but the user doesn't know >it. That's an interesting case. Maybe we should have something like the log4j folks: Their appenders can be marked "closed" which allows them to keep them around after a config reload. Actually, this is a general problem with our implementation -- having a Perl API in parallel with a configuration file which can be reloaded and render any appender references obtained via the Perl API (even as simple as Log::Log4perl::Appender->new()) invalid. This is most likely why the reason the log4j folks have this weird notion of config file reloading, keeping then useless appenders around (but marking them 'closed' I think). Anyway, I think that it's ok if you put appenders_by_name() in there, it's no worse than Log::Log4perl::Appender->new(). Long term we probably need to re-think the config file reloading, I think I understand now why Ceki did it the way he did it :). -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |