When dealing with XMLSignature generation and verification I had to debug and came across strange logging behavior (I would call it bugs, but maybe I don't have the full picture).
The logger access method com.sun.org.slf4j.internal.LoggerFactory#getLogger
is part of the jdk and is used internally to obtain a logger instance - checked with jdk12.
That logger is used for example by org.jcp.xml.dsig.internal.dom.DOMReference
and other different XMLSignature related classes.
The returned logger is an instance of com.sun.org.slf4j.internal.Logger
and that is a simple
wrapper that delegates every call to an instance of java.util.logging.Logger
.
My first observation
The placeholder {}
known from slf4j is used in log massage and I think, the author expected some sort of parameter replacement should be done.
Example from org.jcp.xml.dsig.internal.dom.DOMReference
LOG.debug("Reference object uri = {}", uri);
Since the logger is a simple wrapper and doesn't do any processing, this isn't replaced.
My log message is the unreplaced log string.
Update The logger doesn't do anything at all:
public void debug(String s, Throwable e) {
impl.log(java.util.logging.Level.FINE, s, e);
}
public void debug(String s, Object... o) {
impl.log(java.util.logging.Level.FINE, s, o);
}
Question: Is this a bug or did I forget to turn on "something"?
My second observation
In com.sun.org.slf4j.internal.Logger
debug log level is mapped to fine and trace log level is mapped to fine as well. I would have expected that trace level is mapped to finest,
but that doesn't matter, because trace isn't used anyway.
My last observation
Why did they use slf4j in the package name? This is very confusing.