Discussion: How should an application’s log work

An oldie but goodie discussion on slashdot about what needs to be done to make sure that application logs are useful to actually troubleshoot problems.

At reading level 4 (as linked), the suggestions actually make sense.

Try a quick test. If you are developing a software which produces a log file, or better yet many log files, how long would it take to extract all events produced by user X between 2pm and 3pm of July 30th?

You need to quickly locate files (where is the location encoded?), extract a regexp defined subset of time (do your log messages split over multiple lines and therefore not greppable?), and narrow it down to a specific user (do you even record that in the logs?).

And that’s a basic task. With Java, you also have to deal with multiple threads, which most applications don’t bother identifying. If you don’t log it, even the most clear event sequences under single thread condition start looking very confusing when multiple threads are running similar tasks at the same time.

BlogicBlogger Over and Out