I tried a simple example from the SLF4J FAQ :
package com.aed.tests.logging; import org.slf4j.LoggerFactory; public class TestLogging { public TestLogging() {
Here is the result:
15:33:51,248000000 [SEVERE]simplelogger: Failed to format Hello world 15:33:51,275000000 [SEVERE]simplelogger: Without parametrized string
I use java.util.logging as a log implementation, with the following logging.properties
I was expecting to see stacktrace exceptions. Am I missing something in the configuration? Should I somehow enable straw restriction tracing with the SLF4J or jdk protocol?
EDIT After "Marked as duplicate." My question was not βhow to print the stack traceβ, but how does it turn out, using the very example SLF4J, which itself performs the task to print the stack trace, I still did not print the stack trace. As I said, I had a stack trace using log4j as an implementation, but not java.util.logging. So it really was the wrong java.util.logging configuration, and I gave the answer when I found out.
source share