Punter Vicky
Punter Vicky

Reputation: 16982

Pivotal Cloud Foundry - Application Logging

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?

Upvotes: 1

Views: 14096

Answers (3)

Mahesh Kumar
Mahesh Kumar

Reputation: 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/

Upvotes: -1

Corby Page
Corby Page

Reputation: 1405

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

Upvotes: 0

K.AJ
K.AJ

Reputation: 1292

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

Upvotes: 3

Related Questions