Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 10
    I like this answer but I would add that it's important to log what choice was made at decision points. I've seen many systems where a lot of junk was logged but key decisions were not loggged. So 95% of the logging is basically useless. Also for request/response type systems it's more important to be able to log per request than by subsystem. Commented Oct 5, 2011 at 0:20
  • 4
    +1. I like your point about putting yourself in a troubleshooter's shoes. It sounds like log statements should contain a lot more quality messages then what we have been doing... Commented Oct 5, 2011 at 0:45
  • 1
    It's important to note that error logging should be logged to the appropiate eventlog as well as application logs. Commented Oct 5, 2011 at 19:55
  • 2
    @SnOrfus: There are multiple ways to store logs, but the essence is that log messages need to be available up to the very last second the system crashed - like an aircraft black box. If you use any kind of buffering, provide an option to bypass it / flush every message. Commented Oct 6, 2011 at 4:06
  • 1
    @Rig: on the other hand, many home-grown loggers did not implement any buffering (and dutifully flush every message), leading to very poor performance. This is why it must be made optional. Commented Dec 5, 2013 at 21:53