From: Tod H. <th...@gi...> - 2004-10-14 14:59:30
|
My configuration file... # for now we'll just define one level of capture at the top of the hierarchy. # This way we can capture everything to this one log and refine things as we go log4perl.rootLogger = DEBUG, SYNCER log4perl.OpenTrade.XSLTOutputFilter = DEBUG, SYNCER log4perl.OpenTrade.XSLTOutputFilter.detail = FATAL, SYNCER # Basic file-based log log4perl.appender.LOGFILE = Log::Log4perl::Appender::File log4perl.appender.LOGFILE.filename = /var/www/web.thebeast.local/logs/handler.log log4perl.appender.LOGFILE.mode = append log4perl.appender.LOGFILE.layout = PatternLayout log4perl.appender.LOGFILE.layout.ConversionPattern = [%d] %C - %m%n # Make sure each perl thread/child doesn't step on the others via Synching! log4perl.appender.SYNCER = Log::Log4perl::Appender::Synchronized log4perl.appender.SYNCER.appender = LOGFILE Relevant section of the manual Turn off a component Log4perl doesn't only allow you to selectively switch on a category of log messages, you can also use the mechanism to selectively disable logging in certain components whereas logging is kept turned on in higher-level categories. This mechanism comes in handy if you find that while bumping up the logging level of a high-level (i. e. close to root) category, that one component logs more than it should, Here's how it works: ############################################################ # Turn off logging in a lower-level category while keeping # it active in higher-level categories. ############################################################ log4perl.rootLogger=debug, LOGFILE log4perl.logger.deep.down.the.hierarchy = error, LOGFILE # ... Define appenders ... This way, log messages issued from within Deep::Down::The::Hierarchy and below will be logged only if they're error or worse, while in all other system components even debug messages will be logged. The problem is, this is a nice theory but its a fiction that the code actually works this way... I've also discovered that if you set your rootLogger to say 'INFO' and lower levels of the heirarchy to 'DEBUG', you NEVER get anything except 'INFO' level and lower from ANY part of the heirarchy. This seems to be in direct contradiction of the manual and tutorials. What gives guys? This just isn't working as advertised. |