Jeff Mesnil
Weblog · About

More on logging

November 26, 2004

I had two interesting comments on my blog concerning logging.

BlogicBlogger added some advices to my list. He especially emphasizes the need to uniquely identify the logs (with session Id, transaction Id,...). If you log a multithreaded application, you need more contextual information than in a single user application because same parts of the code can be executed by different threads on behalf of different users and the logs are of no use if you can't follow the flow of execution for a given user ("user" may not be the appropriate term, e.g. it could also be a transaction).

Scott Deboy proposed me to use Chainsaw to watch the log files. I was aware of the product but I need to check that it can be used with an inconsistent log format (those dreaded System.err.print() are mixed in the log4j files).

I saw a lot of documentation on logs but I find surprising that there is not so much good documentation on the specificity of logging multithreaded applications.