Logger #
The Logger class is the application logger. It is based on kuzzle-logger, which uses pino.
It is accessible from the Backend.log property. Plugins get a child of the Kuzzle logger through the PluginContext.logger property.
Before Kuzzle 2.45.0, Backend.log was an InternalLogger. The debug, info, warn and error methods keep their name, so most code needs no change.
The class itself is not exported by the kuzzle package. In TypeScript, use Backend["log"] to name its type.
Logs are written by the transports set in the server.appLogs section of the configuration (stdout by default, initial level info). Unlike InternalLogger, the logger is usable before the application is started.
Each log line carries the logger's namespace (kuzzle:app for app.log), the failsafeMode flag and, once the node has an identifier, its nodeId.
level #
Current log level. Set it to change the level at runtime.
| Type | Get / Set | Description |
|---|---|---|
string | get / set | trace, debug, info, warn, error, fatal or silent |
A child logger (see child) follows the level of its parent until its own level is set.
Usage #
app.log.level = 'debug';