I’ve noticed stacktrace.log showing up all over my system. The smart thing would have been to immediately link it to my recent surge in grails activity, but google wasn’t hinting me in this direction. The fact that these where empty files, didn’t help either.
I’d even gone as far as to write a shell script called cleanStacks on my production system
It turns out, this is mentioned in the grails reference however:
When exceptions occur, there can be an awful lot of noise in the stacktrace from Java and Groovy internals. Grails filters these typically irrelevant details and restricts traces to non-core Grails/Groovy class packages.
When this happens, the full trace is always written to the StackTrace logger. This logs to a file called stacktrace.log
The solution is to edit your grails-app/conf/Config.groovy, and change the line
StackTrace="error,stacktraceLog"
to
StackTrace="error"
I think it’s a good idea to print full stacktraces to a log file, but the problem is that the file is produced, relative to where I start tomcat from. Since I invoke tomcat restart from various paths in my production system, these files where cluttering up my system