【发布时间】:2014-04-21 23:05:16
【问题描述】:
我们不时喜欢其他人都喜欢使用插件。不幸的是,它们并不总是记录得那么好。有时您很幸运,会发现 OH 调试日志已包含在内。
如何为插件开启日志记录?
如果插件打包成org.plugin.special,下面是我们的日志设置,如何添加呢?
log4j = {
appenders{
rollingFile name: "myAppender", maxFileSize: 1024, file:'/development/log/eightstates.log'
console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n'), threshold: org.apache.log4j.Level.DEBUG
}
debug myAppender: [
'grails.app.controllers.come.example.eightstates',
'grails.app.domain.come.example.eightstates',
'grails.app.services.come.example.eightstates',
'grails.app.taglib.come.example.eightstates',
'grails.app.conf.come.example.eightstates',
'grails.app.filters.come.example.eightstates',
'grails.app.controllers.org.grails.paypal']
}
【问题讨论】:
-
要找出日志的名称,只需在该源代码中打印
log.name,然后将其添加到您的 log4j 设置中。
标签: grails logging grails-2.0 grails-plugin