DEV Community

Discussion on: Logging! How do you decide on your app log levels and outputs?

Collapse
 
dmfay profile image
Dian Fay

The answers to 1 and 2 are pretty contextual. The best I can give for 1 is "when you think you might need it", which is less than helpful. 3 though:

  • trace is for following something through the code line by agonizing line
  • debug is for stuff you'll want to know when you're trying to analyze application behavior
  • info is for 'good to know' status messaging
  • warn is for a problem you'll start caring about if it starts happening a lot
  • error is for a problem you'll care about no matter what
  • the occasionally-available fatal is for when something has literally caught fire
  • I've never seen a "verbose" log level; it's usually a flag that enables higher-level messaging (debug and up)

Or: