Open Maldivia opened 5 hours ago
Linked to https://jira.qos.ch/browse/LOGBACK-1775
@Maldivia
Thank you for this report. Issue fixed in commit 85968fa3fe217a79760ec2b4a275e68cefeb8656
Please note that log.makeLoggingEventBuilder(Level.WARN)
is a longer form for log.atWarn()
.
If a
Throwable
type is passed to match the last{}
argument, it is ignored, and the formatted log message will write{}
instead.Example:
Expected output:
Actual output:
Workaround: Explicitly calling
.toString()
on the argument (log.error("Exception Message: {}", ex.toString(), ex)
), or adding a bogus extra""
argument (log.error("Exception Message: {}", ex, "", ex)
) works as a work around, but causes static analysis tools, including the one in IntelliJ, to warn about it.