message
key in payload overwrites logging message
#194
Unanswered
chrisbloom7
asked this question in
Q&A
Replies: 1 comment 4 replies
-
The use of this older backward compatible API is not recommended, since it has to automagically guess what you are trying to do. The result is what you are seeing above. logger.debug "Message received", message: message The correct api to use when supplying a payload is to supply the logger.debug "Message received", payload: { message: "message" } |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
Provide at least:
Note:
Expected Behavior
When logging something like
I expect it to output
Actual Behavior
Instead, the
message
in the payload overwrites the firstmessage
argument, such that it is logged like this instead:It does not matter if the second argument is passed as an implicit or explicit hash. For instance, this has the same result
The only way to work around it is to not use a key of
message
or to use the longer form of the logger API, i.e.as documented in https://logger.rocketjob.io/api.html#standard-logging-methods
Pull Request
Beta Was this translation helpful? Give feedback.
All reactions