Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Changing spring boot app log level in Cloud Run

Is it possible to update log level for a spring boot app running in Cloud Run without restarting the Cloud Run service(with multiple instances) ? Invoking spring boot logger actuator endpoint will only update for one instance and not all CloudRun instances.

0 2 828
2 REPLIES 2

Hi @achalsingh,

Welcome to Google Cloud Community!

 
To update the log level for a Spring Boot app running in Cloud Run without restarting the service, even with multiple instances:
  1. Enable the Actuator endpoints in your app.
  2. Use a tool to invoke the loggers endpoint and change the log level.
  3. Propagate the log level change to all instances of the service.

You can use the Google Cloud Console, the Cloud SDK, or a third-party tool to invoke the loggers endpoint and propagate the log level change.

Note:

Changing the log level at runtime is not a best practice, as it can have a negative impact on performance. However, there are some cases where it may be necessary, such as when you need to quickly debug a problem or troubleshoot an issue.

Thanks

@christianpaula Can you please help as to how we can do

You can use the Google Cloud Console, the Cloud SDK, or a third-party tool to invoke the loggers endpoint and propagate the log level change.