尝试从GetThatDataFilters类获取所有日志语句,以转到滚动文件'dailydata'以及控制台和每日滚动文件的所有其他内容。
不知道我是否遗漏了grails文档http://www.grails.org/doc/latest/guide/3.%20Configuration.html#3.1.2%20Logging
中的内容// ============================================================================
// log4j configuration
//============================================================================
log4j = {
// Example of changing the log pattern for the default console
// appender:
//
appenders {
console name: 'stdout', layout: pattern(conversionPattern: '%d %-5p %c{1} - %m%n')
//daily rolling log
appender new DailyRollingFileAppender(name: 'daily', datePattern: "'.'yyyy-MM-dd",
layout: pattern(conversionPattern: '%d %-5p %c{1} - %m%n'),
file: 'logs/daily.log')
//daily search rolling log
appender new DailyRollingFileAppender(name: 'dailydata', datePattern: "'.'yyyy-MM-dd",
layout: pattern(conversionPattern: '%d %-5p %c{1} - %m%n'),
file: 'logs/daily-data.log')
}
error dailysearch: "GetThatDataFilters"
root {
error 'stdout', 'daily'
additivity = true
}
debug 'grails.app'
}
答案 0 :(得分:3)
尝试以下方法:
error dailydata: "GetThatDataFilters", additivity: false
root {
error 'stdout', 'daily'
additivity = true
}
debug 'grails.app'