title: Logging errors in different files based on type of exception using Log4j
body: <p>I am using log4j for logging.</p>
  
  <p>Tried using custom log levels in log4j with no success.
  This is something like my <code>log4j.properties</code></p>
  
  <pre><code>log4j.logger.com.some.services.Class1=ERROR1, Appender1
  log4j.logger.com.some.services.Class1=ERROR2, Appender2
  log4j.appender.Appender1.File=${SOME_PATH}/log1.log
  log4j.appender.Appender2.File=${SOME_PATH}/log2.log
  </code></pre>
  
  <p>And using custom log levels like this:-</p>
  
  <pre><code>private static final Level ERROR1= Level.forName("ERROR1", 50);
  private static final Level ERROR2= Level.forName("ERROR2", 150);
  .
  .
  . 
  try
  {
   ...
  }
  catch(Exception1 e1)
  {
  // log in log1.log file
    logger.log(ERROR1, "Some message");
  }
  catch(Exception2 e2)
  {
  // log in log2.log file
    logger.log(ERROR2, "Another message");
  }
  </code></pre>