What to log/trace in a Production environment
.net, language-agnostic, logging
Solution
It really depends upon you, there are no hard & fast rules.
Couple of months back we were working on this Java application and used log4j for logging, in log4j we were able to define in code our logs as either debug, warning, error, info etc.
Our debug logging was almost on every functions start & end, every successful not successful transaction was logged as "info", "error" in exceptions were logged & likewise.
Once we moved the application in the production environment after a month or so we switched off all debug logging through .properties files without restarting the application & we were good to go.
Problem
I'm wondering what kind of information should be logged to a file once an application has moved into a Production environment? Besides the logging of exceptions and errors... Should the start and end of each method be logged? The start and end of a running service? Each time the application saves data to a database or calls an external service? I'm trying to find the balance between logging/tracing everything and only logging errors.