Docker – How to specify the log tag from docker compose on google logging

dockerdocker-composefluentd

In my docker compose file, I can specify the logging driver as a "fluentd" and by default, it pushes the log to the listener of google-fluentd on port 24224

I can see the log appear on the logging page along with the tag as the container Id.

enter image description here

Howerver, look like I cannot figure out how to change the tag name to something I want (instead of container Id)

My configuration in the docker compose is quite simple

logging:
  driver: fluentd
  options:
    tag: "my-server" # does not work

Update: look like the options are not effective. No matter what I change in the tag option, it does not work. Even when I put some crazy options, it still run but without the correct tag

Best Answer

Problem solve: I need to remove the container and create it again. the new tag will get affected