在像this这样的典型Spring Boot应用程序中,我们如何配置它以使用“自定义”日志配置?
例如,在我的应用运行的当前环境中,logback导致错误,我如何使用其他日志记录,例如:
[INFO] java.lang.NoClassDefFoundError: java.io.FileOutputStream is a restricted class. Please see the Google App Engine developer's guide for more details.
[INFO] at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:100)
[INFO] at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:58)
[INFO] at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:181)
[INFO] at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:122)
[INFO] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
[INFO] at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:92)
[INFO] at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:58)
答案 0 :(得分:1)
Spring Boot默认配置Logback,您使用标准配置 - 在运行时只需要logback.xml
或logback.groovy
作为类路径资源。在GAE案例中,您需要配置记录器以使用GAE批准的输出目标。