General logging characteristics
-
Requests are not logged per default
Request are not logged per default unless an error occurs. -
Request based logging on demand
Request based logging can be activated by changing the log level via environment variables, see Condition Monitoring - Helm Configuration. -
Configurable LogLevel
Log level can be configured via environment variables, see Condition Monitoring - Helm Configuration. -
Log analysis tool independent logging
A technology independent log pattern is used to process logs from all IAS modules in one logging system. -
Single line messages
Logs are written as single line formatted json. -
Log to stdout
Logs are written to stdout, for the purpose of being collected from there. -
Log in english
Log message which are not presented to the "end-user" are written in English.
Loglevel guidelines
Preliminary Remark:
Logging can be configured during setup and configuration phase, see Condition Monitoring - Helm Configuration.
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
One Line Formatted LIFE-CYCLE Log Example
{"timestamp":"2017-08-01T07:48:09.916Z","environment":"AZURE","system":"PROD","product":"nexeed-cm","application":"condition-monitoring-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"}
Pretty Printed LIFE-CYCLE Log Example
{
"timestamp": "2017-08-01T07:48:09.916Z",
"environment": "AZURE",
"system": "PROD",
"product": "nexeed-cm",
"application": "condition-monitoring-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"
}