title: How to separate logs for multiple containers in a single host?
body: <p>I have to run more than one containers with the same application. However, the logging logic is under the application and will write it to a log file.</p>
  
  <p>Under the situation, how can i separate logs for different instance for application without modifying the application logging code.</p>
  
  <h2>EDIT</h2>
  
  <ul>
  <li>we want the log to be persistent.</li>
  <li>we also want the log files to be stored under the same directory in host machine, like /var/log/app/*.log. This is mainly used to be consistent with former settings.</li>
  <li>we can not modify the logging logic is that we are under testing about using docker. We need the app to both run under docker and normal situation without modifying code just for adding support for test in docker.</li>
  <li>currently, we want to use shared volume, since all the applications developed almost all write log to a file. </li>
  </ul>