I use docker swarm to deploy a cluster of a spring-boot application on the same host. The working directory for the docker container is /app, and I do the configuring so that the log files are put in folder /app/logs. I want to see the log files in the directory
/opt/logs of the host machine, so in the docker-compose.yml file, I have
volume: - /opt/logs:/app/logs
but since I have a cluster of containers for the same springboot application, all log files in different containers will be mounted to the same /opt/logs on the same host machine, then there is conflict.
What can I do to deal with such an issue?