简体   繁体   中英

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?

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

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

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM