在Intellij中找不到日志记录路径 [英] Could not find logging path in Intellij

查看:77
本文介绍了在Intellij中找不到日志记录路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置我的日志记录路径,这样我就可以看到当前正在执行的跟踪文件中的跟踪 logging.path = c:\ temp \ tracefile.log 但我看不到任何跟踪文件.因此,有人可以建议这是怎么回事.

I want to set my logging path so I can see the traces in the trace file currently I am doing like this logging.path = c:\temp\tracefile.log but I dont see any tracefile. So could anyone suggest what is wrong with this.

否则,还有其他方法可以获取跟踪.请提出建议.

Or otherwise is there any other way to get the traces. please suggest.

推荐答案

application.properties文件中指定以下属性:

Specify the following properties in your application.properties file:

logging.path=/temp/log                  # path for a logging file.
logging.file=tracefile.log              # Log file name.
logging.level.org.springframework=DEBUG # Log levels severity mapping.

如果使用logging.file属性,Spring将写入指定的日志文件.名称可以是确切的位置,也可以是相对于当前目录的位置. 如果使用logging.path属性,Spring Boot将在此指定路径中创建一个spring.log文件.

If you use logging.file property, Spring writes to the specified log file. Names can be an exact location or relative to the current directory. If you use logging.path property, Spring Boot creates a spring.log file in this specified path.

但是,您不能同时指定logging.filelogging.path属性.如果完成,Spring Boot将忽略两者.

However, you cannot specify both the logging.file and logging.path properties together. If done, Spring Boot will ignore both.

详细了解常见应用属性.

这篇关于在Intellij中找不到日志记录路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆