所以我在Config.groovy中使用Grails log appender,如下所示:
console name: 'stdout',
threshold: org.apache.log4j.Level.FATAL
appender new org.apache.log4j.DailyRollingFileAppender(name: "full",
threshold: org.apache.log4j.Level.ERROR,
file: "/tmp/test.log" );
我有这样的环境配置:
environments {
root {
info 'full', 'stdout'
additivity=true
}
development {
}
}
如何在开发环境中更改阈值?
答案 0 :(得分:1)
environments {
root {
info 'full', 'stdout'
additivity=true
}
development {
appender new org.apache.log4j.DailyRollingFileAppender(name: "test",
threshold: org.apache.log4j.Level.DEBUG,
file: "/tmp/test.log" );
}
}
答案 1 :(得分:1)
root {
additivity=true
}
environments {
development {
info 'full', 'stdout'
}
stage {
info 'full', 'stdout'
}
production {
error 'full', 'stdout'
}
}