title: Linux-Java logs rotating using log4j or logrotate.d
body: <p>I have a Spring project using log4j on Linux (Debian, Ubuntu and RHEL). Now I would like to implement best practice logs rotation for the log4j generated logs.</p>
  
  <p>I have previously used logrotate.d for other non-java components and it worked great for me. I needed rotating by size/time and compressing the old logs and logrotate could do all of this.</p>
  
  <p>I am new to log4j and now wonder how should I configure log rotation.</p>
  
  <ol>
  <li>Should I use log4j only for logging and logrotate for rotation?</li>
  <li>Use only log4j for rotation?</li>
  <li>Use a mix of both?</li>
  </ol>
  
  <p>What is your experience? What is the best practice?</p>