简体   繁体   English

使用 Spring 启动空日志文件正在生成

[英]using Spring boot empty log file is getting generated

I have a simple Spring boot rest API application.我有一个简单的 Spring 启动 rest API 应用程序。 I am managing logs via the below properties mentioned in the application.property file.我通过 application.property 文件中提到的以下属性管理日志。

logging.level.org.springframework=INFO logging.level.org.springframework=INFO

logging.level.com.learning=DEBUG logging.level.com.learning=DEBUG

logging.file.name=application.log logging.file.name=application.log

logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg% logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%

I can see logs are getting printed on console but same logs I don't see in the log file which got created via application.我可以看到日志正在控制台上打印,但我在通过应用程序创建的日志文件中看不到相同的日志。

Am I missing anything?我错过了什么吗?

Change the logging.pattern.file to logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] - %msg%将 logging.pattern.file 更改为logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] - %msg%

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

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