我正在尝试将信息、警告和错误日志分开,我做了以下配置,但是在信息文件上继续在同一文件上记录其他类型的日志,我已经尝试搜索其他主题但我没有找到一个解决方案,有人可以帮忙吗?
def logLayoutPattern = new PatternLayout("%d{yyyy-MM-dd/HH:mm:ss.SSS} %x %-5p %c{2} - %m%n")
appenders {
appender new DailyRollingFileAppender(name: "perfil",threshold: Level.INFO,file: "/tmp/logs/file_perfil.log",datePattern: "'.'yyyy-MM-dd",layout: logLayoutPattern)
appender new DailyRollingFileAppender(name: "errors",threshold: Level.ERROR,file: "/tmp/logs/file_errors.log",datePattern: "'.'yyyy-MM-dd",layout: logLayoutPattern)
appender new DailyRollingFileAppender(name: "warn",threshold: Level.WARN,file: "/tmp/logs/file_warn.log",datePattern: "'.'yyyy-MM-dd",layout: logLayoutPattern)
}
info perfil: ["grails.app.controllers.com.app.PerfilController"]
warn warn: 'grails.app'
error errors: ['org.codehaus.groovy.grails.web.servlet',
'org.codehaus.groovy.grails.web.pages',
'org.codehaus.groovy.grails.web.sitemesh',
'org.codehaus.groovy.grails.web.mapping.filter',
'org.codehaus.groovy.grails.web.mapping',
'org.codehaus.groovy.grails.commons',
'org.codehaus.groovy.grails.plugins',
'org.codehaus.groovy.grails.orm.hibernate',
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate']
root {
error 'errors'
additivity = false
warn 'warn'
additivity = false
info 'perfil'
additivity = false
}