3 ms·
Info: What is the program up to. Occasional messages that indicate it is alive and doing what is expected. Warn: Problems that you know about and wish would no
by testplzignore 8y ago
Info: What is the program up to. Occasional messages that indicate it is alive and doing what is expected.
Warn: Problems that you know about and wish would not happen, but do anyways. A service call has failed, unexpected input that violates the contract of the method, etc. You may be handling these conditions gracefully and/or returning an error to the caller, but still want to know when they happen. Usually you should have a ticket open in your bug tracker for these.
Error: Problems that you do not know about. When an error is logged, a developer should look at it. Some kind of action should be taken immediately. Put the fire out if it is an emergency. If not an emergency, create a ticket in your bug tracker, then change the level to warn.
I keep warn and info separate so that I can easily grep/filter on one. I often want to just see info messages to know what the status of things are.
- jandrese 8y agoIMHO the difference between Warn and Error is that Warn is recoverable while Error is not.
- hinkley 8y agoIn an enterprise setting, treating one level of logs as actionable, as GP mentions, is a very important for clarifying responsibilities. If it takes the right pair of eyes on the logs to see a problem for what it is, the whole process slows down and doesn't scale as high. All errors and very chatty warnings should induce me to ask someone what's going on, to make sure it hasn't slipped through the cracks. And they should thank me for pointing it out. Otherwise you reinforce some bad patterns.
- paulddraper 8y agoWhat does recoverable mean though? If the server process handles it without crashing, is that a recovery? A more general distinction IMO is the one presented in the article: an Error is something that should not have happened. A Warning is something that maybe should not have happened.