title: Can you redirect stdout, stderr to a fileappender in log4j2 v2.3?
body: <p>This is my log4j2.xml configuration file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
    &lt;Appenders&gt;
      &lt;Console name="Console" target="SYSTEM_OUT" ignoreExceptions="false"&gt;
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
      &lt;/Console&gt;
      &lt;File name="Log4JFile" fileName="/log/Log4JFile.log"&gt;
        &lt;PatternLayout&gt;
          &lt;Pattern&gt;%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n&lt;/Pattern&gt;
        &lt;/PatternLayout&gt;
      &lt;/File&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
      &lt;Root level="trace"&gt;
        &lt;AppenderRef ref="Console"/&gt;
        &lt;AppenderRef ref="Log4JFile"/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>I'm using Jboss and if you do not include a configuration file, <code>log4j</code> logs everything to <code>server.log</code>. I need to log all of the levels of <code>log4j</code> plus <code>stdout</code> and <code>stderr</code> to a separate file that is not the default one. How can I accomplish this without overriding the print method in Java?</p>