title: Log4j: How to configure multiple appenders: one directed to the console and a file and the other strictly to a file?
body: <p>For my application, I have managed to configure log4j to generate multiple logs. <br><br>
  Both of the appenders output to the console and to a file. <br>But since the first log is my main log, I feel that this log should be the only log outputed to the console.<br><br> 
  Would it be possible to disable the second log so that log4j does not use the console but still write to the file?</p>
  
  <pre><code>log4j.rootLogger=DEBUG, stdout
  
  # stdout is set to be ConsoleAppender sending its output to System.out
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss SSS}ms %-5p [%t] - %m%n
  
  log4j.appender.X=org.apache.log4j.FileAppender
  log4j.appender.X.File=X.log
  log4j.appender.X.Append=false 
  log4j.appender.X.layout=org.apache.log4j.PatternLayout
  log4j.appender.X.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss SSS}ms %-5p [%t] - %m%n
  log4j.logger.X=DEBUG,X
  </code></pre>
  
  <p>the second appender 'Y' is configured the same way as 'X' .</p>
  
  <p>I was also thinking of disabling altogether the console for both appenders and use: tail -f X.log inside a shell window to view the logs but it is not very practical when working inside Eclipse. </p>
  
  <p>Any tips would be greatly appreciated.</p>
  
  <p>Regards,  </p>