How do I make Grails start a new log file on startup of the application?
Which log4j appender should I use and how do I configure it? I'm not too bothered about keeping old logs, so I don't care about truncating the existing o开发者_运维百科ne.
Assuming you're logging to file, all log4j file appenders have an append
property which you can set to false to always start fresh, or true to append to previous logs. eg:
appenders {
rollingFile name: 'file', file: 'mySite.log', append: false
}
精彩评论