title: Different Logger in the same class using Log4J
body: <p>I want specific messages generated from within the same class to be logged separately. So, how can I create 2 different types of loggers within the same class. Currently, the Properties file looks like</p>
  
  <pre><code>log4j.rootCategory=DEBUG, O
  
  # Stdout
  log4j.appender.O=org.apache.log4j.ConsoleAppender
  log4j.appender.O.layout=org.apache.log4j.PatternLayout
  log4j.appender.O.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x - %C.%M(%F:%L) - %m%n
  
  # File
  log4j.appender.MESSAGE=org.apache.log4j.RollingFileAppender
  log4j.appender.MESSAGE.File=target/logs/messages.log
  # Control the maximum log file size
  log4j.appender.MESSAGE.MaxFileSize=1000KB
  # Archive log files (one backup file here)
  log4j.appender.MESSAGE.MaxBackupIndex=100
  log4j.appender.MESSAGE.layout=org.apache.log4j.PatternLayout
  log4j.appender.MESSAGE.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x - %C.%M           (%        F:%    L) - %m%n
  log4j.appender.MESSAGE.
  
  log4j.category.failedMessagesLog=INFO, MESSAGE
  </code></pre>
  
  <p>I'm using the logging in my code as: – 
  /** Logger. */</p>
  
  <pre><code>Logger logger = Logger.getLogger(MyClass.class);
  Logger msgLogger = Logger.getLogger("MESSAGE");
  </code></pre>
  
  <hr>
  
  <p>Upon testing, I get an empty log file (messages.log) created. 
  Any suggestions??</p>