View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page

myApp/config/log.js

Purpose

This file contains the logger configuration for your Sails app.

Configure the log level for your app, as well as the transport.

Underneath the covers, Sails uses Winston for logging, which allows for some pretty neat custom transports/adapters for log messages.

/**
 * Built-in Log Configuration
 * (sails.config.log)
 *
 * Configure the log level for your app, as well as the transport
 * (Underneath the covers, Sails uses Winston for logging, which
 * allows for some pretty neat custom transports/adapters for log messages)
 *
 * For more information on the Sails logger, check out:
 * http://links.sailsjs.org/docs/config/log
 */

module.exports = {

  // Valid `level` configs:
  // i.e. the minimum log level to capture with sails.log.*()
  //
  // 'error'    : Display calls to `.error()`
  // 'warn'    : Display calls from `.error()` to `.warn()`
  // 'debug'    : Display calls from `.error()`, `.warn()` to `.debug()`
  // 'info'    : Display calls from `.error()`, `.warn()`, `.debug()` to `.info()`
  // 'verbose': Display calls from `.error()`, `.warn()`, `.debug()`, `.info()` to `.verbose()`
  //
  log: {
    level: 'info'
  }

};

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be immediately reflected on the website.