0.3.3-patch.2 • Published 5 years ago

@ngbrown/bunyan-seq v0.3.3-patch.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

bunyan-seq Build status NPM

A Bunyan stream to send events to Seq. Tested with Node.js versions 4.2.2 and up.

Usage

Use the createStream() method to create a Bunyan stream configuration, passing serverUrl, apiKey and batching parameters.

let bunyan = require('bunyan');
let seq = require('bunyan-seq');

var log = bunyan.createLogger({
    name: 'myapp',
    streams: [
        {
            stream: process.stdout,
            level: 'warn',
        },
        seq.createStream({
            serverUrl: 'http://localhost:5341',
            level: 'info'
        })
    ]
});

log.info('Hi!');
log.warn({lang: 'fr'}, 'Au revoir');

You can specify property names as tokens in the log message to control how the event is rendered in Seq:

// Seq will render this as 'Hi, Alice!'
log.info({user: 'Alice'}, 'Hi, {user}!');

Read the complete documentation.