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 myNormalD
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
.getProperty('my property') instead of S
Either you strongly restrict the level of your root logger (e.g. ERROR) and
declare a logger for your own classes with DEBUG level:
(appender-refs)
(appender-refs)
Or you go the other way round, you restrict the library loggers stro
[Not pasting the big log file]
You need to use a log4j.xml in the classpath. The format/how to of the
log4j.xml is explained in this link
http://logging.apache.org/log4j/1.2/manual.html
Many examples are provided here
http://wiki.apache.org/logging-log4j/Log4jXmlFormat.
To cut the short story eve