Simon
Simon

Reputation: 80889

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 one.

Upvotes: 0

Views: 222

Answers (1)

Dave Bower
Dave Bower

Reputation: 3567

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
}

Upvotes: 1

Related Questions