I use java.util.logging and plan to use log4j 2.0 in current projects. Now, that I'm going to use logging more seriously I would like to get some advice from experienced developers what content/parts should go into a log message (date,time,level,source,message,...) to ease later analysis and interpretation of log messages. Any advice?
Asked
Active
Viewed 122 times
0
-
This may be useful: [http://stackoverflow.com/questions/2031163/when-to-use-log-level-warn-vs-error][1] [1]: http://stackoverflow.com/questions/2031163/when-to-use-log-level-warn-vs-error – Remko Popma Oct 28 '14 at 14:25
-
Hi, the referenced SO entry was basically about the right log level. My question is mode general, i.e. regarding all parts of the log entry, i.e. which date/time format, source file/package/class, message details (and its format) .... I'm asking this here because I would like to ease any later analysis (possibly using LogStach, ElasticSearch, ...) – Tom Nov 05 '14 at 13:52
-
You just try, see what works and keep that, see what does not work, and change that. Lather, rinse, repeat. – Remko Popma Nov 05 '14 at 14:29