When i create a container group with 2 desired instances with a command containing the volume specification as follows:
> ... -v log_vol:/opt/ibm/logs --env
> LOG_LOCATIONS=/opt/ibm/logs/messages.log,/opt/ibm/logs/debug.log,/opt/ibm/logs/trace.log
> -e TRACE_LEVEL=*~info -e MAX_LOG_FILES=5 -e MAX_LOG_FILE_SIZE=20 ...
In this case each individual running-container-instance of the group will have a similar directory /opt/ibm/logs/
to store logs.
When the application within the individual container instance generates logs, the log data is lost as it is mounted to a shared volume called log_vol
. The logs get replaced on every new entry.
- Can someone suggest me on how to handle it?
- Are there any ways that we can attach a volume specification post container instance creation?