简体   繁体   English

是否可以为 Glassfish 上的一组应用程序类设置不同的日志级别?

[英]Is it possible to set an different log level for a set of application classes on Glassfish?

Well, I've already tried to add an entry on Glassfish's Console Configuration > server-config > Logger Settings but it doesn't seem to work.好吧,我已经尝试在 Glassfish 的控制台配置 > 服务器配置 > 记录器设置上添加一个条目,但它似乎不起作用。

What I'd like to do is logging in FINEST level just a set of classes under, for instance: br.com.mycompany .我想要做的是登录 FINEST 级别,只是下面的一组类,例如: br.com.mycompany

Have anyone tried something like that?有没有人尝试过这样的事情?

What I'd like to do is logging in FINEST level just a set of classes under, for instance: br.com.mycompany我想要做的是登录 FINEST 级别,只是下面的一组类,例如:br.com.mycompany

Unless that logger was created by the code, setting the log level will not make any difference .除非该记录器是由代码创建的,否则设置日志级别不会有任何区别 You have to set the level on all the child loggers of br.com.mycompany or you have to write code to manually create that parent logger and hold a strong reference to it.您必须在br.com.mycompany所有子记录器上设置级别,或者您必须编写代码来手动创建该父记录器并保持对它的强引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM