BobCoder
BobCoder

Reputation: 823

What is the format of zookeeper logs?

I am trying to understand the zookeeper logs format so that I can write a regular expression for that but I could not find any article what exactly appearing in the logs Below is the on log line from zookeeper . Can someone help me what exactly is getting logged between [ ] ? Is it package name / class name ? What 0.0.0.0 stands for ?

2017-08-08 08:13:25,635 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@964] - adding SASL authorization for authorizationID: samepleApp_runtime

Upvotes: 0

Views: 917

Answers (1)

sel-fish
sel-fish

Reputation: 4486

Find it in your config conf/log4j.properties.

Take my config and log as an example.

Related config:

log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

Related log:

2017-02-28 17:28:30,126 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@839] - Client attempting to establish new session at /0:0:0:0:0:0:0:1:52466

The content between [] is [%t:%C{1}@%L], you may find the meaning of %t liked symbols here.

0.0.0.0 is part of %t,which is the name of thread. The related code you can find in NIOServerCnxnFactory.java:

@Override
public void configure(InetSocketAddress addr, int maxcc) throws IOException {
    configureSaslLogin();

    thread = new Thread(this, "NIOServerCxn.Factory:" + addr);

Upvotes: 1

Related Questions