From 994f90eb830a3e272ceb2d31c53bf6aa67cfbd1d Mon Sep 17 00:00:00 2001 From: Greg Walden Date: Fri, 13 Jan 2017 12:49:10 -0500 Subject: [PATCH] note how to add streams in the readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 65ed51e..283cdf0 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ record (see below). * [Recommended/Best Practice Fields](#recommendedbest-practice-fields) * [Other fields to consider](#other-fields-to-consider) - [Streams](#streams) + * [Adding a Stream](#adding-a-stream) * [stream errors](#stream-errors) * [stream type: `stream`](#stream-type-stream) * [stream type: `file`](#stream-type-file) @@ -740,6 +741,20 @@ on log records). If neither "streams" nor "stream" are specified, the default is a stream of type "stream" emitting to `process.stdout` at the "info" level. +## Adding a Stream + +After a bunyan instance has been initialized, you may add additional streams by +calling the `addStream` function. + +```js +var bunyan = require('bunyan'); +var log = bunyan.createLogger('myLogger'); +log.addStream({ + name: "myNewStream", + stream: process.stderr, + level: "debug" +}); +``` ## stream errors