Format and Consistency of Log statements in Geronimo
We [Professor and PhD Student in Software Engineering at a
State University in India] are working towards a source code analysis tool
which can assist practitioners in writing effecting log statements. There are
more than 10000 log statements in Geronimo (s_logger.error, s_logger.warn,
The focus of this email is on format and consistency of log
statements. We analyzed all the log statements and observe that the log
statements prints a message and variable(s).
However it does not print the log level, timestamp and thread-name. I believe
you agree with me that - Information like timestamp [Date date= new Date(); new
Timestamp(date.getTime())] and thread-name [Thread.currentThread().getName()] is
useful for diagnosing production failure and root-cause analysis. It is also
useful in studying patterns and trends.
There are only 2 places where we found the thread-name to be
log-level, timestamp and thread-name is not logged.
important (different people may have different opinion) is Point 1 (mentioning log-level,
timestamp and thread-name)
there a standard guideline for developers for writing log statements – which Geronimo
developers need to follow
you use any log-analysis tool? How are logs analyzed (visual inspection,
home-grown tool/program, external open-source/commercial tool)?
can be used in a multi-threaded environment and I am not clear why the thread
name is not printed
Thanks in advance and appreciate it. We want to build a tool (not
just about format and consistency) that will be practically useful to practitioners
and will make it open-source & publicly available. This is part of an
academic/research study and hence request a response to all questions.