如何摆脱Glassfish上特定包的精细日志消息

时间:2014-07-28 09:46:29

标签: java logging glassfish-3

我正在玩日志文件,不知何故我禁用了所有与日志相关的信息,但是这个javax.enterprise.system.core.security仍然显示FINE级别的日志,有没有办法将这个更改为级别WARN并重置其余的日志级别为默认值。我必须滚动太多才能找到我的例外。

[#|2014-07-28T14:02:42.181+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecClientRequestInterceptor;MethodName=send_request;|Security context is null (nothing to add to service context)|#]

[#|2014-07-28T14:02:42.182+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecServerRequestInterceptor;MethodName=receive_request;|++++ Entered SecServerRequestInterceptor::receive_request|#]

[#|2014-07-28T14:02:42.182+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecServerRequestInterceptor;MethodName=handle_null_service_context;|No SAS context element found in service context list for operation: _is_a|#]

[#|2014-07-28T14:02:42.183+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecurityContextUtil;MethodName=setSecurityContext;|ABOUT TO EVALUATE TRUST|#]

[#|2014-07-28T14:02:42.183+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecClientRequestInterceptor;MethodName=receive_reply;|++++ Entered SecClientRequestInterceptor::receive_reply|#]

[#|2014-07-28T14:02:42.184+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecClientRequestInterceptor;MethodName=handle_null_service_context;|No SAS context element found in service context list|#]

[#|2014-07-28T14:02:42.184+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecClientRequestInterceptor;MethodName=setreplyStatus;|Status to be set : 0|#]

[#|2014-07-28T14:02:42.185+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecurityContextUtil;MethodName=receivedReply;|Passed status|#]

[#|2014-07-28T14:02:42.185+0500|FINE|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.iiop.security|_ThreadID=42;_ThreadName=Thread-2;ClassName=com.sun.enterprise.iiop.security.SecClientRequestInterceptor;MethodName=setreplyStatus;|Invoked receivedReply()|#]

1 个答案:

答案 0 :(得分:0)

如果您使用的是log4j,则可以创建log4j类别和后续的appender来控制日志记录。

例如:类别:

log4j.category.javax.enterprise.system.core.security=WARN, S

Appender:

log4j.appender.S=org.apache.log4j.RollingFileAppender
log4j.appender.S.File=${myWebapp-instance-root}/log/External.log
log4j.appender.S.MaxFileSize=1MB
log4j.appender.S.MaxBackupIndex=10
log4j.appender.S.layout=org.apache.log4j.PatternLayout
log4j.appender.S.layout.ConversionPattern=%d %p %t %c - %m%n