如何从 grails log4j 附加程序中排除包
我在 Config.groovy 中配置了一个附加程序,如下所示:
all myLog:['grails.app.controller', 'grails.app.service', 'grails.app.domain', 'grails.app.task'], additivity: false
现在上述包中有一个我不想记录的特殊包,例如 grails.app.service.some。服务。
如何从 myLog
Appender 中排除此包?我已经找到这个 StackOverflow 问题和答案,但我没有知道如何将其“翻译”到我的 grails 配置中。
I have an appender configured in Config.groovy
like this:
all myLog:['grails.app.controller', 'grails.app.service', 'grails.app.domain', 'grails.app.task'], additivity: false
Now there is a special package inside the above packages which I don't want to log, e.g. grails.app.service.some.service
.
How can I exclude this package from the myLog
Appender? I already found this StackOverflow question and answer, but I don't know how to "translate" this into my grails configuration.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通常在 Grails 中以不同的方式定义日志级别,例如:
要禁用特定包甚至类中的日志,我会这样做:
这样做的好处是,您可以完全控制每个包甚至每个包的日志级别如果需要的话可以上课。
希望这有帮助!
I usually define the log level in Grails differently, something like:
And to disable the log in a specific package or even a class I do:
The good thing about this is that you can have full control of the log level per package or even per class if necessary.
Hope this helps!