我的问题是我与实例关联的服务帐户没有Logs Writer
权限。我发现通过运行sudo systemctl status stackdriver-logging
显示如下的命令:
● stackdriver-logging.service - Fluentd container for Stackdriver Logging
Loaded: loaded (/usr/lib/systemd/system/stackdriver-logging.service; static; vendor preset: disabled)
Active: active (running) since Fri 2021-03-05 01:18:55 UTC; 1h 12min ago
Main PID: 385 (docker)
Tasks: 9 (limit: 2382)
Memory: 31.9M
CPU: 751ms
CGroup: /system.slice/stackdriver-logging.service
└─385 /usr/bin/docker run --rm --name=stackdriver-logging-agent -v /etc/stackdriver/logging.config.d/:/etc/google-fluentd/config.d/ -v /var/log:/var/log -v /var/lib/docker/containers/:/v
Mar 05 02:30:11 jwp-gitlab-runner-m3l0 docker[385]: 2021-03-05 02:30:11 +0000 [warn]: #0 Dropping 1 log message(s) error="User unauthorized to access *** for resource ***
通过谷歌搜索错误消息,我在 GitHub 问题https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/issues/295中找到了答案
以下答案也帮助我诊断了问题:https ://stackoverflow.com/a/65768214/8016720
现在,我在 Cloud Logging 中拥有了我想要的所有日志。