Score:0

steps to safely logrotate on Cloud Run containers

jp flag

As /var/log is a black box, as it's engineered by PaaS mount which we don't really are able to inspect.

The context is that log files supposedly are building up storage space counting towards the memory, and over the time of an instance they should be cleanup.

Do we have a way to know when a log entry has been picked up, and safe to be removed? Do you know if there is an automatic logrotate included in the hidden-gem-stackdriver integration?

How do we know when it's safe to issue a logrotate? What's the recommendation here, shall we use separate files every 1 minute, 10-15 minutes? hourly?

Score:2
in flag

Cloud Run automatically sends the log entries received at /var/log to Cloud Logging. It does not retain these logs in a local file and these logs do not count against the memory allocated to your container.

As a developer, you should not need to worry about cleaning up /var/log on Cloud Run and can assume that anything that you have written to /var/log will end up in Cloud Logging with high reliability (higher than if you were sending the logs yourself via an API call)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.