Hi,
We have the following problem, we have 2 projects
prj-cross and smk, in the prj-cross project the containers write to the log without problems, but in smk they don't log anything, only the gcp log. In both projects the service accounts have the same permissions, but we can't understand why in the smk project it doesn't write to the log.
Best regards
Also the application is in nodejs and uses console.log for logging.
The cloud run service accounts and the account that deploys the container in cloud run have roles/logging.logWriter and roles/logging.viewer.
Hi @nortiz,
Welcome to Google Cloud Community!
I understand your concern regarding Cloud Run in smk not recording application logs, whereas prj-cross operates correctly.
Here are my analyses and recommendations: :
console.log("This is an info log");
console.error("This is an error log");
You can also test out Cloud Logging API for your Node.js app.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi,
Thank you for your response.
We checked the configuration and everything looks in order compared to both projects.
Also we are using the same docker image, only in the prj-cross project it does show the log and in SMK it does not.
The cloud run service accounts and the service account that deploys the container in cloud run have roles/logging.logWriter and roles/logging.viewer.
That's why we don't understand why we don't see the logs of the containers.
Best regards
it is not working for me.... I have a simple hello world... in other GCP accounts the service prints fine.. In this particular project it stopped working. It worked for a couple of years but suddenly it is not printing anything. I have 15 services running on Cloud Run... All of them stopped printing a couple of months ago.
Does the logging work when you use it locally with Docker?
Hi,
Yes, it works on docker local machine
The only other thing that I see happening is sink filters in the Log Router that might be redirecting logs away from Cloud Logging. Can you check those?