update readme for serializers
This commit is contained in:
parent
947e46f877
commit
8eb2abd15a
1 changed files with 6 additions and 12 deletions
18
README.md
18
README.md
|
@ -134,23 +134,17 @@ standard serializers you can use:
|
||||||
serializers: Logger.stdSerializers
|
serializers: Logger.stdSerializers
|
||||||
});
|
});
|
||||||
|
|
||||||
|
*Note: Your own serializers should never throw, otherwise you'll get an
|
||||||
|
ugly message on stderr from Bunyan (along with the traceback) and the field
|
||||||
|
in your log record will be replaced with a short error message.*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Future
|
# Future
|
||||||
|
|
||||||
See "TODO.md", but basically:
|
See "TODO.md", but basically:
|
||||||
|
|
||||||
- "Serializer" support to handle extracting a JSON object for a log record
|
- More std serializers. See TODO.md.
|
||||||
for particular object types, e.g. an HTTP request. So for example we
|
|
||||||
could do:
|
|
||||||
|
|
||||||
log.info({req: req}, "something about handling this request")
|
|
||||||
|
|
||||||
And the "req" serializer would extract a reasonable JSON object for that
|
|
||||||
request object -- presumably a subset of all attributes on the request
|
|
||||||
object.
|
|
||||||
|
|
||||||
This will key off the field name, IOW by convention, rather than getting
|
|
||||||
into `instanceof` grossness.
|
|
||||||
|
|
||||||
- Spec'ing and enforcing the fields (from dap's section in eng guide).
|
- Spec'ing and enforcing the fields (from dap's section in eng guide).
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue