You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have a custom field that are user defined zap.Fields.
For custom structured logging
To add user defined fields
Support different entry formats, etc.
Additional Context (optional)
Currently I have an client that want's http headers response into the logging file, that's post processed later. They want all headers, now the fiberzap doesn't have an option for it. Instead of just adding a "respHeaders" field it'll be more extensible to add a custom field that are user definied fields
@mirusky Hi, I have literally just ran into a use case for this, have you started working on the feature at all? I don't want to intrude but I have written the code for it before I saw this open issue.
In my implementation I did opt for naming it FieldsFunc instead of CustomFieldsFunc
I liked your approach, I was thinking on just add a new case statement for custom and call it when user pass custom on fields values. But the way you did gives more flexibility.
Feature Description
I'd like to have a custom field that are user defined zap.Fields.
Additional Context (optional)
Currently I have an client that want's http headers response into the logging file, that's post processed later. They want all headers, now the fiberzap doesn't have an option for it. Instead of just adding a "respHeaders" field it'll be more extensible to add a custom field that are user definied fields
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: