Skip to content

How to update an exists field value? #1240

Answered by prashantv
axiaoxin asked this question in Q&A
Discussion options

You must be logged in to vote

No, there isn't a way to update existing fields, as zap encodes fields as they're added to the logger.

You can add the same field multiple times (#81), but that may lead to undefined behaviour, so I'd recommend using a separate log field.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by abhinav
Comment options

You must be logged in to vote
4 replies
@abhinav
Comment options

@sc-atompower
Comment options

@sc-atompower
Comment options

@abhinav
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #765 on March 02, 2023 19:43.