Embed Apache ZooKeeper in Jetty creates a debug log message

I am using Jetty 8 and ZooKeeper 3.4.5. When I connect to ZooKeeper, the pier continues to generate a DEBUG level message. How to suppress it?

16:54:56.757 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:56.758 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:56.758 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:56.759 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:56.760 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:56.760 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x13ddc6e9a2b000c after 3ms 16:54:56.760 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:58.424 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:58.425 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:58.425 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:58.426 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:58.427 [main-SendThread(127.0.0.1:2181)] DEBUG oazclient.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: Unable to locate a login configuration 16:54:58.427 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x13ddc6e9a2b000c after 2ms 

I added log4j.properties to the src folder:

 # Set root logger level to DEBUG and its only appender to A1. log4j.rootLogger=DEBUG, A1 # A1 is set to be a ConsoleAppender. log4j.appender.A1=org.apache.log4j.ConsoleAppender # A1 uses PatternLayout. log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r - [%t] %-5p %c %x - %m%n log4j.logger.org.apache.zookeeper.ZooKeeper=INFO 

Still out of luck.

+1
source share
2 answers

I checked my included library again and I found out that LogBack is on. I think the JVM loads the login instead of log4j. As soon as I put logback.xml, the problem is resolved.

+2
source

Something like this in config should help:

 <logger name="com.apache.zookeeper" level="info"> <!-- appenders --> </logger> 
+1
source

Source: https://habr.com/ru/post/977111/


All Articles