title: log4j redirect stdout to DailyRollingFileAppender
body: <p>I have a java app that uses log4j. </p>
  
  <p>Config:</p>
  
  <pre><code>log4j.rootLogger=info, file
  
  log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
  log4j.appender.file.File=${user.home}/logs/app.log
  log4j.appender.file.layout=org.apache.log4j.PatternLayout
  log4j.appender.file.layout.ConversionPattern=%d [%t] %c %p %m%n
  </code></pre>
  
  <p>So all the log statements are correctly appended to the file, but i am losing stdout and stderr. How do i redirect exception stack traces and sysouts to the daily rolled file ?  </p>