1

I have a microservice developed using Spring Boot. The application is deployed in pivotal cloud foundry. I have set the logs levels in logback.xml which is part of the application. In order to change the log level , I have to update the logback.xml and rebuild / redeploy the app. Is there a better way to do this without having to redeploy the app? Is there a way to set log level as env variable in PCF?

Punter Vicky
  • 15,954
  • 56
  • 188
  • 315

3 Answers3

3

I have not used logback so don't know much on it. But may be this thread can help - Set Logging Level in Spring Boot via Environment Variable

K.AJ
  • 1,292
  • 11
  • 17
0

If you are using Spring Boot 1.5 or higher, and PCF 1.9 or higher you can change log levels from the Apps Manager without having to redeploy:

http://docs.pivotal.io/pivotalcf/1-9/console/using-actuators.html#manage-log-levels

Corby Page
  • 1,385
  • 10
  • 17
-1

Have you ever thought of externalizing your application configuration.... Pcf provides a service called config-server, which uses a git repo for maintaining your application configuration.... Using spring boot actuator, you can actually reload the updated configuration without actually doing redeploy/rebuild of your app. This links should help you: https://docs.pivotal.io/spring-cloud-services/1-5/common/config-server/index.html

https://spring.io/guides/gs/centralized-configuration/

Mahesh Kumar
  • 1
  • 1
  • 2