I assume you mean following (pseudo code) If SystempropertyCollectStatistics==True myLog.info( ... )
The correct way would be to use a special named logger and declare it in the propeties file with the desired log level. Possible code in class with statstic logging needs: Logger myNormalDebugLogger = Logger.getLogger( <CLASS> ); Logger myStatisticLogger = Logger.getLogger( "StatisticLogger" ) static int count = 0; void foo() myNormalDebugLogger.debug( "entering foo()..." ); count++; if myStatisticLogger.isInfoEnabled() myStatisticLogger.info( "foo() called now " + count + " times" ); ... Within the configuration file you can enable the statistics by setting the level of "StatisticLogger" to INFO, disable it by setting it to WARN or OFF. Heri -----Ursprüngliche Nachricht----- Von: Christophe Elek [mailto:ce...@ca.ibm.com] Gesendet: Montag, 9. März 2009 15:09 An: log4j-user@logging.apache.org Betreff: [SPAM (Bayesain Analysis)] - Using log4j.properties to handle other properties - Bayesian Filter detected spam My developers are using System Properties to enable certain trace options (like collecting statistics) Is there a way I could define such property in the log4j.properties instead so we keep trace/log options and metadata together ? So my developers will do <aLog 4J object>.getProperty('my property') instead of System.getProperty() ? Christophe Elek - Senior Software Analyst IBM Rational Serviceability Architect IBM Toronto Lab 8200 Warden Avenue, Markham, Ontario, L6G 1C7 Phone Number: (905) 413-3467 Email: ce...@ca.ibm.com Rational Internal Serviceability Portal "Don't just fix the mistakes - fix whatever permitted the mistake in the first place." Charles Fishman Web:http://www.ibm.com/software/rational/ --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org