title: Configuring Log4j Loggers Programmatically
body: <p>I am trying to use SLF4J (with <code>log4j</code> binding) for the first time.</p>
  
  <p>I would like to configure 3 different named Loggers that can be returned by a LoggerFactory which will log different levels and push the messages to different appenders:</p>
  
  <ul>
  <li>Logger 1 "FileLogger" logs DEBUG and appends to <code>DailyRollingFileAppender</code></li>
  <li>Logger 2 "TracingLogger" logs TRACE+ and appends to a <code>JmsAppender</code></li>
  <li>Logger 3 "ErrorLogger" logs ERROR+ and appends to a different <code>JmsAppender</code></li>
  </ul>
  
  <p>Furthermore I want them configured programmatically (in Java, as opposed to XML or a <code>log4j.properties</code> file).</p>
  
  <p>I imagine that, normally, I would define these <code>Logger</code>s somewhere in some bootstrapping code, like an <code>init()</code> method. However, because I want to use <code>slf4j-log4j</code>, I'm confused about where I could define loggers and make them available to the classpath.</p>
  
  <p>I don't <em>believe</em> this is a violation of SLF4J's underlying purpose (as a facade), because my code using the SLF4J API won't ever know that these loggers exist. My code just makes normal calls to the SLF4J API, which then forwards them on to the log4j Loggers it finds on the classpath.</p>
  
  <p><strong>But how do I configure those log4j Loggers on the classpath...in Java?!</strong></p>