Core
Guides v2.x
2

Internal Logger #

Kuzzle uses Winston to log messages.

The internal logger has 5 priority levels:

  • debug (not printed by default)
  • verbose (not printed by default)
  • info
  • warn
  • error

Winston is able to redirect the logs on differents "services" 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 plugins.kuzzle-plugin-logger.services.stdout.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 verbose
app.config.set(
  'plugins.kuzzle-plugin-logger.services.stdout.level', 
  'verbose');

app.start()
  .then(() => {
    app.log.debug('debug');
    app.log.verbose('verbose');
    app.log.info('info');
    app.log.warn('warn');
  });