We are managing our services log levels with spring boot admin app, which lets us change log levels in live services. However we need a feature to get these log levels to default values once a certain time passes, basically to make sure we are not overflowing with huge log sizes.

I opened the following issue to spring boot admin project. https://github.com/codecentric/spring-boot-admin/issues/1449 They replied as this would be a valuable feature, however it would be much better to implement at actuator side, as otherwise it would require retries and state management on spring boot admin. After some consideration I also agree that this would be a much cleaner solution.

Would it be possible to add such a feature, that would change log levels back to default after a specified time passes?

Comment From: encircled

We were discussing the same thing a couple of weeks ago in my company and I found it very useful too. I've prepared a draft PR

Comment From: philwebb

Flagged as pending-design-work because we need to consider the following:

  • Should we be adding this feature at all in Boot, or would it be better for external projects to handle it?
  • If we do add it, should it be in the LoggingSystem or kept as an actuator feature?
  • What should the API actually look like?
  • What should handle the scheduling, is the extra thread worth it?
  • What happens if another timeout call is made before the timeout completes?
  • What happens if someone manually sets the logging level when a timeout is active, should it cause the timeout reset to be cancelled?