Turns out this exact question was answered on the Grails mailing list a couple of days ago.
The solution is to add the following to the Config.groovy log4j section:
log4j { ... appender.mail='org.apache.log4j.net.SMTPAppender' appender.'mail.To'=' email@example.com ' appender.'mail.From'=' email@example.com ' appender.'mail.SMTPHost'='localhost' appender.'mail.BufferSize'=4096 appender.'mail.Subject'='App Error' appender.'mail.layout'='org.apache.log4j.PatternLayout' appender.'mail.layout.ConversionPattern'='[%r] %c{2} %m%n' rootLogger="error,stdout,mail" ... // rootLogger="error,stdout" (old rootLogger) }
Plus adding sun-javamail.jar and activation.jar to the lib / folder.
knorv source share