简体   繁体   English

Pivotal Cloud Foundry - 应用程序日志记录

[英]Pivotal Cloud Foundry - Application Logging

I have a microservice developed using Spring Boot.我有一个使用 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.我在应用程序的一部分 logback.xml 中设置了日志级别。 In order to change the log level, I have to update the logback.xml and rebuild / redeploy the app.为了更改日志级别,我必须更新 logback.xml 并重建/重新部署应用程序。 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?有没有办法在 PCF 中将日志级别设置为 env 变量?

I have not used logback so don't know much on it.我没有使用过 logback,所以对它了解不多。 But may be this thread can help - Set Logging Level in Spring Boot via Environment Variable但也许这个线程可以提供帮助 - 通过环境变量在 Spring Boot 中设置日志记录级别

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:如果您使用的是 Spring Boot 1.5 或更高版本,以及 PCF 1.9 或更高版本,您可以从 Apps Manager 更改日志级别而无需重新部署:

http://docs.pivotal.io/pivotalcf/1-9/console/using-actuators.html#manage-log-levels 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.你有没有想过将你的应用程序配置外部化...... Pcf 提供了一个名为 config-server 的服务,它使用一个 git repo 来维护你的应用程序配置...... 使用 spring boot actuator,你实际上可以重新加载更新的配置而无需实际重新部署/重建您的应用程序。 This links should help you: https://docs.pivotal.io/spring-cloud-services/1-5/common/config-server/index.html此链接应该可以帮助您: https ://docs.pivotal.io/spring-cloud-services/1-5/common/config-server/index.html

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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