Closed BigBoulard closed 8 months ago
Hi @BigBoulard
Accourding to documentation you need to call .Msg("")
or .Send()
to dispose the *Event
.
It should be mentioned that in this case (when the message is missing), the log will not contain the "message" field.
You can ommit the .Err()
method and use only .Msg(err.Error())
Hi team,
Disclaimer: I never logged at production grade so my questions may be dumb.
I can see this kind of code in your docs:
log
is the logger,Error()
sets the error level, andErr()
should contain the raw error from what I understand, but I don't get the point ofMsg
. What is expected to be passed toMsg()
?In my microservice app, only the gateway is logging, other services only return errors to each other up to the gateway. The errors are wrapped by each layer of each microservice up to the gateway which logs an error like this one:
I really have a doubt cause I am pretty sure I've read that some apps are only logging from the gateway but that would make the
correlationID
that I see everywhere completely useless. On the other hands, I see that error in go should be wrapped for better tracking of the execution path so I'm a bit lost ... Any advice is gold to me.Thank you so much.