Skip to content

Commit

Permalink
note how to add streams in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gswalden authored and trentm committed Mar 21, 2017
1 parent 34f4469 commit 994f90e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 994f90e

Please sign in to comment.