Internal Logger #
Kuzzle uses its own opinionated wrapper around Pino to log messages.
The internal logger has 6 priority levels:
- trace (not printed by default)
- debug (not printed by default)
- info
- warn
- error
- fatal
Pino is able to redirect the logs on differents "transports" like stdout, syslog, Elasticsearch etc.
By default, the logs are printed to stdout.
Usage in an Application #
Available since 2.8.0
The Internal Logger is available only during the runtime
phase, after the application has started.
Messages will be logged using the util.inspect method from Node.js.
By default the log level is set to info
. You can change this configuration under the server.appLogs.level
configuration key.
Example: Set the log level to verbose and log verbose messages
import { Backend } from "kuzzle";
const app = new Backend("black-mesa");
// Set log level to debug
app.config.set("server.appLogs.level", "debug");
app.start().then(() => {
app.log.trace("trace"); // will not be printed
app.log.debug("debug");
app.log.info("info");
app.log.warn("warn");
app.log.level("trace"); // change log level at runtime
app.log.trace("trace"); // will get printed this time
});
Edit this page on Github(opens new window)