每次我们启动 Spring Boot 应用程序时,Spring Boot 都会打印以下行:
2017-07-20 00:43:53.605 INFO 3857 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@65d83111: startup date [Thu Jul 20 00:43:53 UTC 2017]; root of context hierarchy.
我想更改上述行的时间戳格式,即[Thu Jul 20 00:43:53 UTC 2017]
。如果不是,至少禁用打印时间戳。我该怎么做?
最佳答案
直接的答案是,将以下行添加到位于 my_awesome_project/src/resources
的 application.properties
文件中。
logging.pattern.console= %-5level %logger - %msg%n
要了解有关自定义日志记录的更多信息,请参阅以下链接:
关于java - 从控制台禁用/更改 Spring Boot 的 ApplicationContext 的时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45220645/