Using docker-compose a container is launched into rancher. Rancher is told to spawn two containers in a stack.
The problem arises trying to read the logs from these two containers it is not clear where the log lines are coming from container-1 or container-2.
The log driver section of docker-compose looks like:
logging: driver: awslogs options: awslogs-region: eu-central-1 awslogs-group: $LOGGING_CONTEXT-$RANCHER_STACK awslogs-create-group: true tag: my_Container_Name
Where the tag line defines the log stream name and is currently hard coded. After extensive searching, no solution has presented itself yet this seems like it should be quite common.
The desired goal is to replace ‘my_Container_Name’ with something that resolves to:
Please note that some docker provided properties resolve into terms like:
There’s probably something simple that I’m missing.
Any insight or guidance would be gratefully received, thank you.