Skip to content

Commit 994f90e

Browse files
gswaldentrentm
authored andcommittedMar 21, 2017
note how to add streams in the readme
1 parent 34f4469 commit 994f90e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎README.md

+15
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ record (see below).
4343
* [Recommended/Best Practice Fields](#recommendedbest-practice-fields)
4444
* [Other fields to consider](#other-fields-to-consider)
4545
- [Streams](#streams)
46+
* [Adding a Stream](#adding-a-stream)
4647
* [stream errors](#stream-errors)
4748
* [stream type: `stream`](#stream-type-stream)
4849
* [stream type: `file`](#stream-type-file)
@@ -740,6 +741,20 @@ on log records).
740741
If neither "streams" nor "stream" are specified, the default is a stream of
741742
type "stream" emitting to `process.stdout` at the "info" level.
742743
744+
## Adding a Stream
745+
746+
After a bunyan instance has been initialized, you may add additional streams by
747+
calling the `addStream` function.
748+
749+
```js
750+
var bunyan = require('bunyan');
751+
var log = bunyan.createLogger('myLogger');
752+
log.addStream({
753+
name: "myNewStream",
754+
stream: process.stderr,
755+
level: "debug"
756+
});
757+
```
743758
744759
## stream errors
745760

0 commit comments

Comments
 (0)
Please sign in to comment.