Prepend a prefix in every logs generated in the application #1290
Unanswered
meetme2meat
asked this question in
Q&A
Replies: 2 comments
-
weird this still isn't answered |
Beta Was this translation helpful? Give feedback.
0 replies
-
Did you try it? https://stackoverflow.com/questions/70489167/uber-zap-logger-how-to-prepend-every-log-entry-with-a-string |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I had set up the zap logger with following configuration
Help me understand if is it possible to prepend a prefix to every log message (DEBUG, INFO) something like what log library provides https://pkg.go.dev/log#SetPrefix
and the prefix is
"=>"
The final log line would appear like this
I tried with
log.With
API but it seems to create a new JSON object which is different from what I need.Beta Was this translation helpful? Give feedback.
All reactions