logfellow/logstash-logback-encoder

Slf4j v2 addKeyValue fluent API silently ignores all logs where Protobuf objects are given

Proximyst opened this issue · 0 comments

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:

  1. Have a Protobuf object
  2. Call LOGGER.atError().withKeyValue("obj", protobufObject).log("test")
  3. 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