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.
Under the situation, how can i separate logs for different instance for application without modifying the application logging code.
EDIT
- we want the log to be persistent.
- 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.
- 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.
- currently, we want to use shared volume, since all the applications developed almost all write log to a file.