-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callable custom context serialized on object creation instead of logging call #673
Comments
Found out that it's not typescript specific. Defining a serializer for the field will work around the issue:
|
Sorry, I've got to reopen this. Changing the title so it matches the problem. I'm still trying to make bunyan log a request with an id. Extra fields are serialized only once: When the logger is created. This makes it impossible to use an extra field for my purpose. |
I had to make such wrapper to make it work: |
In #457 you recommend passing a callable to log the request id.
Is this limited to pure javascript? In typescript it seems I can pass custom strings only. I assume
genRequestId
in your example is a function, right? in @types/bunyancustom
is an array of strings.logs this:
(Notice the request id is missing).
Node 12.22.4
Bunyan: 1.8.15 or 2.0.5
macos bigsur
This was initially a comment on #457, but I think it's rather a bug, than a request for support. Also, my comment didn't reopen the issue, so I feared it wouldn't be noticed.
The text was updated successfully, but these errors were encountered: