logstash-logback-encoder
logstash-logback-encoder copied to clipboard
Slf4j v2 addKeyValue fluent API silently ignores all logs where Protobuf objects are given
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
ERRORseverity 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