stacktrace.log文件太大 [英] stacktrace.log file is too large
问题描述
在我的项目的目标目录中,有一个名为stacktrace.log的文件。我意识到文件的大小已经超过3千兆字节。我删除此文件是否安全?删除它后会导致任何文件没有发现异常?感谢您的时间。
---编辑
如果确实导致文件未找到异常,怎么能我解决了这个问题?
您可以在 Config.groovy 中的 log4j
DSL 中找到 appenders
块下。默认行为相当于一个appender定义
文件名:'stacktrace',file:'stacktrace.log`
在产品模式下和文件:'target / stacktrace.log'
在开发模式下,你可以用例如
rollingFile名称替换它:'stacktrace',file:'stacktrace.log ',
maxFileSize:'5MB',maxBackupIndex:2
将其限制为15MB活动文件加上最多两个滚动备份)。
Inside the target directory of my project, there is a file called stacktrace.log. I have realised size of the file has become more than 3 gigabytes. Is it safe for me to delete this file? Would it cause any file not found exceptions after deleting it? Thanks for your time.
---edit
If it does cause file not found exception, how can I resolve the issue?
stacktrace.log
is the default location where Grails writes the unfiltered stack traces of exceptions thrown by the app (for normal logging it filters out stack frames that are "internal" groovy mechanics, but sometimes it can be too aggressive so it's handy to have the full traces available). You can safely delete it and it will get recreated empty next time the app starts.
You can control this in the log4j
DSL in Config.groovy
, under the appenders
block. The default behaviour is equivalent to an appender definition of
file name:'stacktrace', file:'stacktrace.log`
in prod mode and file:'target/stacktrace.log'
in dev mode, you could replace it with e.g.
rollingFile name:'stacktrace', file:'stacktrace.log',
maxFileSize:'5MB', maxBackupIndex:2
to limit it to 15MB (the active file plus up to two rolled-over backups).
这篇关于stacktrace.log文件太大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!