问题描述
我想设置我的日志记录路径,这样我就可以看到当前正在执行的跟踪文件中的跟踪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 thislogging.path = c:\temp\tracefile.logbut 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.file
和logging.path
属性.如果完成,Spring Boot将忽略两者.
However, you cannot specify both the logging.file
and logging.path
properties together. If done, Spring Boot will ignore both.
详细了解常见应用属性.
这篇关于在Intellij中找不到日志记录路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!