New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suspected tiny bug in logging statement #51
Comments
Hi, thanks for the report! I've been staring at the offending line for quite some time and can't figure out what the problem is. The exception is logged here: dalesbred/dalesbred/src/main/java/org/dalesbred/transaction/DefaultTransaction.java Lines 58 to 62 in 4f53ff6
That looks just like it should be: first the message template itself, then I wrote a short standalone program to check this: fun main() {
val log = LoggerFactory.getLogger("my-logger")
val e1 = Exception("first")
val e2 = Exception("second")
log.error("testing format string: {}", e1, e2)
} Output is:
If I change the format call to
Calling I spent some time inside debugger to find out what goes wrong and it seems to be a bug in logback. First it correctly detects the last parameter as the exception of the log-event, extracts it from the parameter list and trims the parameter list to include only the first parameter. Everything goes as it should be. However, next it calls After having a feeling for this issue I did some searching and found issue LOGBACK-1302. There's also a PR qos-ch/slf4j#166 which fixes the problem, but it's been open since 2016, so I wouldn't hold my breath on it landing soon. It's quite disappointing. Since it seems like no fix is coming soon, I'll work around the problem in Dalesbred by calling |
I got this:
2022-04-11 19:18:15.106 [pool-2-thread-1] WARN o.d.transaction.DefaultTransaction - rolled back transaction because of exception: {}
i guess the {} should be removed, or assigned in
The text was updated successfully, but these errors were encountered: