
Note that with the MessageLogger on my fork you can do: String s = "Hello World"; try { throw new NumberFormatException("This is a test"); } catch (NumberFormatException e) {("Failed to format {}", s); logger.error(new ParameterizedMessage("Failed to format {}", s), e); }; Thanks to Joern doing logger.error("Failed to format {}", s, e); will also work correctly. Ralph On Dec 26, 2009, at 3:56 PM, added by portage for gitosis-gentoo wrote:
@@ -980,11 +1004,62 @@ logger.debug("The new entry is {}.", entry);</pre> <code>ILoggerFactory</code> interface as an alternative to inventing your own logging API.</p> </dd> + + <dt><a name="paramException" href="#paramException">In the presence of an + exception/throwable, is it possible to parametizere a logging + statement?</a></dt> + + + <dd> + <p>No. The SLF4J API does not support parametization in the + presence of an exception.