Slf4j v2 addKeyValue fluent API silently ignores all logs where Protobuf objects are given
Proximyst opened this issue · 0 comments
Proximyst commented
Describe the bug
If a protobuf object is given to the addKeyValue
fluent methods, no log is output, regardless of severity level.
To Reproduce
Here is a minimal reproduction repository: https://github.com/Proximyst/logstash-encoder-addkeyvalue-ignoring-objects-bug
Steps:
- Have a Protobuf object
- Call
LOGGER.atError().withKeyValue("obj", protobufObject).log("test")
- See the
ERROR
severity log be silently swallowed with no output whatsoever
Expected behavior
At the very least output what goes wrong in logging. Preferably, of course, it should just log it properly (be it as a string, as a proper object, or some other way). Even ignoring the specific field would be miles better than how it works today.
Additional context
Add any other context about the problem here.
- logstash-logback-encoder version: 7.4
- logback version: 1.4.14
- jackson version: 2.16.1
- java version: 17 & 21