zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Stephenson <luke.stephen...@gmail.com>
Subject Re: turning off per class logging
Date Mon, 23 Feb 2015 21:04:43 GMT
Hello,

This is some general feedback, nothing specific to zookeeper.

Where in the log4j documentation does it say you can set the log level per
class as a jvm property?  I've not seen this before and couldn't see it
when I looked through the documentation.
http://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties
.

I'd suggest using a log4j xml configuration file as documented here
http://logging.apache.org/log4j/2.x/manual/configuration.html

Luke

On 24 February 2015 at 04:01, Ben Hsu <ben.hsu@criticalmedia.com> wrote:

> Hello
>
> I wish to suppress zookeeper logging at the class level. I see a lot of
> messages in my log along these lines:
>
> 2015-02-23 16:54:53,192 - INFO  [NIOServerCxn.Factory:/0.0.0.0:2181
> :NIOServerCnxnFactory@197] - Accepted socket connection from /
> 127.0.0.1:37142
> 2015-02-23 16:54:53,202 - INFO  [NIOServerCxn.Factory:/0.0.0.0:2181
> :NIOServerCnxn@827] - Processing srvr command from /127.0.0.1:37142
> 2015-02-23 16:54:53,205 - INFO  [Thread-3:NIOServerCnxn@1007] - Closed
> socket connection for client /127.0.0.1:37142 (no session established for
> client)
> 2015-02-23 16:54:53,234 - INFO  [NIOServerCxn.Factory:/0.0.0.0:2181
> :NIOServerCnxnFactory@197] - Accepted socket connection from /
> 127.0.0.1:37143
> 2015-02-23 16:54:53,235 - INFO  [NIOServerCxn.Factory:/0.0.0.0:2181
> :NIOServerCnxn@827] - Processing wchs command from /127.0.0.1:37143
> 2015-02-23 16:54:53,237 - INFO  [Thread-4:NIOServerCnxn@1007] - Closed
> socket connection for client /127.0.0.1:37143 (no session established for
> client)
>
>
> I want to set logging for the NIOServerCnxn and NIOServerCnxnFactory
> classes to WARN, but keep everything else at the INFO level. How can I do
> this?
>
> I tried to set log4j properties at the class level:
>
> java -Dlog4j.logger.org.apache.zookeeper.server.NIOServerxnFactory=WARN
> -Dlog4j.logger.org.apache.zookeeper.server.NIOServerCnxn=WARN
> -Dzookeeper.log.dir=/var/log/ -Dzookeeper.root.logger=CONSOLE -cp
>
> /etc/zookeeper::/usr/lib64/zookeeper/bin/../zookeeper-3.4.6.jar:/usr/lib64/zookeeper/bin/../lib/jline-0.9.94.jar:/usr/lib64/zookeeper/bin/../lib/log4j-1.2.16.jar:/usr/lib64/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/usr/lib64/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/usr/lib64/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar
> -Dcom.sun.management.jmxremote
> -Dcom.sun.management.jmxremote.local.only=false
> org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/zoo.cfg
>
> This didn't work: log messages for those two classes are still coming out.
> I tried with the lower case ("warn" instead of "WARN") and that didn't work
> either
>
> Further playing around with setting zookeeper.root.logger to ERROR makes me
> wonder if zookeeper is honoring these command line parameters at all
>
> I don't see any reference to a log4j.properties, and running it under
> strace tells me its not opening a log4j file anywhere.
>
> any ideas?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message