Skip to content

Cookbook: Configure Logging

DavidSouther edited this page Nov 28, 2014 · 4 revisions

Change log level

Rupert's logger has 9 levels. From most to least promiscuous, they are 'silly', 'data', 'debug', 'verbose', 'http', 'info', 'warn', 'error', and 'silent'. Default is 'http'.

For the Project

In the Rupert config object, the log object has a property, level. It should be a string, matching one of the above.

For the Run

To change the log level for a single run, set the environment variable LOG_LEVEL to a string value of one of the above.

Change HTTP Log Format

Rupert logs http requests at the 'http' level using morgan. Change the output format using log.level in the Rupert config object, or for a single run with the LOG_FORMAT environment variable. Default value is 'tiny', and valid are any [morgan formats][morgan_format]. At this time, it is not possible to define new morgan types for Rupert.