Default:
{ trace: 50, debug: 40, info: 30, warn: 20, error: 10 }
When a log message is not defined, the data associated with it can be used to create the message. For example:
const logger = require('nomatic-logging');
logger.template = '{method} {url} ==> {status} {length} bytes';
logger.log('info', {
method: 'GET',
url: '/api/v1/users?page=1',
status: 200,
length: 1203
};
The LoggerEntry
(sent on execute
of each associated transport) would include a message
property set to
GET /api/v1/users?page=1 ==> 200 1203 bytes
.
Transports to associated with the Logger
instance.
Options associated with a
Logger
instance. Each property is optional, and as such, have sensible defaults.