Getting started Logging
Tuesday, April 16, 2019 6:30 PMLogging
Graphileon logs information both in the browser and the server. The amount of logging can be set granularly, per module.
Each log entry starts with the module name, followed by the message. Additionally, each message has a log level.
- DEBUG: Low level debugging info, intended for development feedback.
- INFO: Neutral info messages about important processes.
- WARN: Warning messages indicating possible (future) problems.
- ERROR: Error messages indicating a part of the software or configuration is not working as intended.
- FATAL: Error messages indicating the Graphileon cannot continue functioning properly.
For each module, the log level can be set to one of these values, setting the minimal log level for a message to be
shown in the logs. For instance, setting a module's log level to WARN
, it will only show WARN
, ERROR
and FATAL
messages. Additionally, a module's log level can be set to:
- ALL: all log messages will be shown
- NONE: no log messages will be shown
Log levels for each module can be set in the config.json
, in the log
section:
"log": {
"levels": {
"default": "WARN",
"Function": "INFO",
"Trigger": "INFO"
},
"directory": false,
"dateformat": "HH:MM:ss.L",
"format": "{{timestamp}} <{{title}}> {{message}}"
}
This section sets the default log level to WARN
(hiding INFO
and DEBUG
messages),
but sets the log levels of the Function and Triggers modules to INFO
. This will show information about processes in
Functions and Triggers in the console logs that can be useful for dashboard builders.
To get an overview of logging modules, the default log level can be set to ALL
. All messages will shown, prepended
with the module name. To change a module's log level, simply add it to the levels
object in the config, e.g.:
"NetworkView": "DEBUG"
Logs location
The frontend logs will be displayed only in the browser console. The backend logs, by default, are not written to the
file system, but can be configured to do so. If directory
is set to true
, the default logging directory will be
used, in the Graphileon application data directory. It can also be set to a string, pointing
at a custom logging directory. The log levels are respected, however, unexpected application errors are always logged.