Hi,

here are some thougjt about Logs and what need to be done, what could be done, and what I've in mind but that need agreement : 1) Remove System.out from the base code (except for tests and may be for clients). We have 129 of them, but only 24 are found in base code 2) We must switch to NLog4j 1.2.21 for all the projects. Some of them are using slf4j or commons-log, r nlog4j-1.2.17
3) Check that every class that need a logger does it correctly.
4) Gather in a property file *all* the loggers
5) See if we can add some configuration is server.xml file to allow debug mode
6) Check that when log.debug is used, we have a if (log.isDebugEnabled())
7) check if we can add a mechanism (JMX?) to change the log level dynamically 8) Add some cool appender like DatedFileAppender in the default configuration
9) Test the chainsawV2 tool
10) Try to use a MessageFormat to store logs, and the use a RessourceBundle file for error messages (I18n in mind) (beware of synchronization pb !)
11) Add a number for each message. For instance :
* project org.apache.asn1 : 10000
* project org.apache.directory.kerberos.common : 20000
etc.
and
* FATAL : 0 -> 1999
* ERROR : 2000 -> 3999
* WARN : 4000 -> 5999
* INFO : 6000 -> 7999
* DEBUG : 8000 -> 9999

Si if we have a message [24364], then we know that it's a project org.apache.directory.kerberos.common message, and that's it's a WARN level, and that it's number is 364. It will be totally useless for a human-being, but it will be very interesting if we need to grep for some specific errors in a huge log file. (I remember, years ago, having to chew a 2.7 Gbytes log file with regexp to get the valuable infos out of it. Took 8 hours to get them, on a very expensive server which has enough CPU and memory to do it during night. Of course, I got many errors like "Connection failure", which were totally useless, as we used this message for DB connection failures, Ldap connection failures, EJB connection failures - wasn't my code, btw - ;)

wdyt ?

Reply via email to