Enable gcplogging on GCE with docker

Solution 1:

You might want to check below docs and other same issues that already answered by the community.

Docs:
Using the Google Cloud Logging driver for Docker
Cloud Logging driver for a single container

  1. After the instance is created, click the SSH button to open a terminal connected to the machine.
  2. To use the Google Cloud logging driver for Docker, specify the --log-driver=gcplogs command-line argument to the docker run command.

Run the following command to start an NGINX container which writes logs to Cloud Logging:

docker run -d \
    --name mysite \
    --log-driver=gcplogs \
    -p 80:80 \
    nginx

Google Cloud Logging driver with Docker Compose
When using Docker Compose, specify a logging driver for each service in the docker-compose.yml configuration file. For example:

version: '3'
services:
  web:
    logging:
      driver: gcplogs
    ...
  database:
    logging:
      driver: gcplogs
    ...

Google Cloud Logging driver

Stackoverflow
GCP logging driver: failed to initialise
The Google Cloud Logging driver for Docker