Glassfish LDAP日志记录正在填充日志文件

时间:2014-02-21 21:01:17

标签: logging glassfish ldap glassfish-3 java.util.logging

我们正在运行通过LDAP集成到Active Directory服务器的Glassfish 3.1.2.2。 LDAP身份验证工作正常,但我们不断看到日志填满了这样的消息:

[#|2014-02-21T20:45:48.765+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=40;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Connections@7e60743d.release(): notify; size: 1|#]
[#|2014-02-21T20:45:49.311+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|LdapPoolManager: using authmech: simple|#]
[#|2014-02-21T20:45:49.311+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Pool@11e21097 {x.x.x.x:389:::null:glassfish=com.sun.jndi.ldap.pool.ConnectionsRef@44f43371}.get(): x.x.x.x:389:::null:glassfish|#]
[#|2014-02-21T20:45:49.311+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Pool@11e21097 {x.x.x.x:389:::null:glassfish=com.sun.jndi.ldap.pool.ConnectionsRef@44f43371}.size: 1|#]
[#|2014-02-21T20:45:49.311+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Pool@11e21097 {x.x.x.x:389:::null:glassfish=com.sun.jndi.ldap.pool.ConnectionsRef@44f43371}.get(): size after: 1|#]
[#|2014-02-21T20:45:49.311+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Connections@7e60743d.get(): before; size: 1|#]
[#|2014-02-21T20:45:49.327+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|ConnectionDesc.tryUse() com.sun.jndi.ldap.LdapClient@5ec0d168 idle|#]
[#|2014-02-21T20:45:49.327+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Connections@7e60743d.get(): use com.sun.jndi.ldap.LdapClient@5ec0d168; size: 1|#]
[#|2014-02-21T20:45:49.327+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|Use com.sun.jndi.ldap.LdapClient@5ec0d168|#]
[#|2014-02-21T20:45:49.327+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Connections@7e60743d.get(): after; size: 1|#]
[#|2014-02-21T20:45:49.342+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Connections@7e60743d.release(): com.sun.jndi.ldap.LdapClient@5ec0d168; size: 1|#]
[#|2014-02-21T20:45:49.342+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|com.sun.jndi.ldap.pool.Connections@7e60743d.release(): release com.sun.jndi.ldap.LdapClient@5ec0d168; size: 1|#]
[#|2014-02-21T20:45:49.342+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=39;_ThreadName=Thread-2;|Release com.sun.jndi.ldap.LdapClient@5ec0d168|#]

这只是一个样本;像这样的日志记录无休止地重复,绝大多数日志文件都由这些语句组成。奇怪的是,这些是在SEVERE级别记录的,但这些消息对我来说看起来很有信息。这些都不是真正的错误。

我的第一个想法是将javax.enterprise.system.std.com.sun.enterprise.server.logging配置为仅记录致命级别。这确实摆脱了上面的日志消息,但不幸的是它关闭了Glassfish中的各种其他有用的日志记录,所以它不是一个真正的选择。

任何想法上面的日志消息是什么意思,以及如何关闭它们?感谢。

1 个答案:

答案 0 :(得分:0)

这看起来像是记录LDAP连接池。我不知道你是如何实现LDAP集成的,但是默认情况下,这个日志记录没有启用,你必须将它设置为JVM属性。

com.sun.jndi.ldap.connect.pool.debug

这可以设置为fineall,遗憾的是除了删除此属性之外,没有明确的选项将其关闭。

您可以使用以下方式进行设置:

System.setProperty("com.sun.jndi.ldap.connect.pool.debug", "all");

或作为GlassFish管理GUI中的附加JVM选项

-Dcom.sun.jndi.ldap.connect.pool.debug=all

也许这是在您的代码或GlassFish实例中的某处设置的。

如果这样做无效,您可以尝试将com.sun.jndi.ldap.connect.pool的日志级别设置为OFF

另见: