-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
[JSON Output]: allow to add more json data #297
Comments
Thanks for the conversation on GitHub, to recap it here the following changes are probably going to be implemented:
Did I miss anything? This will be a breaking change. |
you could in json mode even keep everything under a "meta" key, that would be just fine in Kibana/Datadog etc You could add a "debug/verbose" flag to the settings so it prints 2 lines, the second one with the meta data JSON stringified |
The log methods now accept an object instead of multiple parameters to allow for the passing of extra keys. These keys can be anything, from cloud-provider to anything else you want to add. There's also a lot of refactoring and making some new interfaces for cleaner passing of parameters BREAKING CHANGE: log methods now take an object as the second parameter instead of having 3 extra optional parameters fix #215 #228 #297
The log methods now accept an object instead of multiple parameters to allow for the passing of extra keys. These keys can be anything, from cloud-provider to anything else you want to add. There's also a lot of refactoring and making some new interfaces for cleaner passing of parameters BREAKING CHANGE: log methods now take an object as the second parameter instead of having 3 extra optional parameters fix #215 #228 #297
Added to v0.4.0. This will most likely be the last pre v1 version. Thanks for the idea |
As an FYI for people upgrading, this release is breaking for some usage
Now fails with the following typescript error
Fixed by changing it to
|
Yep. That was part of the original breaking change of |
The log methods now accept an object instead of multiple parameters to allow for the passing of extra keys. These keys can be anything, from cloud-provider to anything else you want to add. There's also a lot of refactoring and making some new interfaces for cleaner passing of parameters BREAKING CHANGE: log methods now take an object as the second parameter instead of having 3 extra optional parameters fix #215 #228 #297
Feature Request
Describe the solution you'd like
In our application, we have a lot of context which is relevant for our logs.
e.g.
In general, correlation ids and useful metadata you can explorer in a log viewer.
Currently, there is only 1 field that could be used, the requestID, but we need more and do not want to replace the request correlation id.
In Winston, they catalog all these as "meta"
Now, for output, in json mode, it would output
{...meta, ...currentfields}
while in text mode you either leave them out or print them in a block at the end of thee line.By adding them to the json output, you can add columns and filter on these fields, see below for an example in datadog (with only the current fields available)
Teachability, Documentation, Adoption, Migration Strategy
There is no breaking change, a single optional extra param to 'log' would be all that is required.
What is the motivation / use case for changing the behavior?
see above
The text was updated successfully, but these errors were encountered: