Log level guidelines
Preliminary Remark:
Logging can be configured during setup and configuration phase, see General logging
TRACE - Anything at statement level like "start to calculate something", "query something", "loop x of y", etc… is logged at TRACE level.
DEBUG - Anything at method or request processing level e.g.
-
"method entered" or "return with ----" is logged at DEBUG level
-
"HTTP GET /someresource took 5 seconds status 200" but also 4xy statuses
INFO - In the following cases the information is logged at INFO level, e.g.
-
Process life cycle messages, like
-
application started
-
application ready
-
shutdown application
-
-
Administrative events, like
-
(re)load or flush caches
-
(re)load configuration
-
database migrations
-
WARN - Uncommon behaviour or situations, e.g.
-
unavailability of services
-
security related events (potentially malicious)
-
handled failures which prevent the application to work normally as long as the application is able to recover automatically
ERROR - Anything which potentially leads to unexpected behaviour or crashes, e.g.
-
unhandled failures
-
implementation failures
Examples
{"timestamp":"2017-08-01T07:48:09.916Z","environment":"AZURE","system":"PROD","product":"nexeed-pqm","application":"trinity-core-service","version":"1.0.1","instance":"3ae26cd4-7014-11e9-a923-1681be663d3e","thread":"thread-1","logger":"LIFE-CYCLE","loglevel":"INFO","status":"INITIALIZATION","message":"initialize masterdata cache"}
{
"timestamp": "2017-08-01T07:48:09.916Z",
"environment": "AZURE",
"system": "PROD",
"product": "nexeed-pqm",
"application": "trinity-core-service",
"version": "3.0.1",
"instance": "3ae26cd4-7014-11e9-a923-1681be663d3e",
"thread": "thread-1",
"logger": "LIFE-CYCLE",
"loglevel": "INFO",
"status": "INITIALIZATION",
"message": "initialize masterdata cache"
}