note how to add streams in the readme
This commit is contained in:
parent
34f4469a25
commit
994f90eb83
1 changed files with 15 additions and 0 deletions
15
README.md
15
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue