title: SLF4J parameterized logging using varargs method
body: <p>I must be stupid or something, but I seem not to be able to use the <a href="http://slf4j.org/apidocs/org/slf4j/Logger.html#debug%28java.lang.String,%20java.lang.Object...%29" rel="noreferrer">varargs-utilizing</a> parameterized logging methods of SLF4J.
  An example:</p>
  <pre><code>import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  public class LoggingTest {
  
      @Test
      public void loggingTest() {
          Logger logger = LoggerFactory.getLogger(this.getClass());
          int x = 0xdeadbeef;
          long y = 0xdeadbeef;
      
          try {
              throw new Exception(&quot;This is a mighty exception!&quot;);
          } catch(Exception e) {
              logger.error(&quot;I wanna log {} and {} and {} with backtrace&quot;, x, y, 3, e);
          }
      }
  }
  </code></pre>
  <p>On the logging method, eclipse produces such a warning:</p>
  <pre><code>The method error(String, Object, Object) in the type Logger is not applicable for the arguments (String, int, long, int, Exception)
  </code></pre>
  <p>and fails to compile.</p>
  <p>However, if I change the logging call to:</p>
  <pre><code>logger.error(&quot;I wanna log {} and {} and {} with backtrace&quot;, new Object[]{x, y, 3, e});
  </code></pre>
  <p>It compiles and runs as expected (logging 3 &quot;variables&quot; and the exception stack trace).</p>
  <p>The library versions are: slf4j-api-1.7.5.jar, slf4j-log4j12-1.7.5.jar and log4j-1.2.14.jar, if it makes any difference.</p>
  <p>If anybody would point out the shortcomings of my thinking abilities, it'd be very much appreciated!</p>