问题
I have written a small main class which will instantiate a zookeeper server.
public class ZooKeeper {
public static void main(String[] args) {
QuorumPeerMain qp = new QuorumPeerMain();
QuorumPeerConfig config = new QuorumPeerConfig();
try {
config.parse("D:\\kafka_2.12-2.2.0\\config\\zookeeper.properties");
qp.runFromConfig(config);
System.out.println("Started....");
} catch (Exception e) {
e.printStackTrace();
}
}
}
I give a parameter in -Dlog4j.debug -Dlog4j.configuration=file:D:\zookeeper-3.4.14\conf\log4j.properties -Dzookeeper.log.dir=D:\kafka_2.12-2.2.0\logs in VM arguments and also changed the log4j property to zookeeper.log.dir=D:/kafka_2.12-2.2.0/logs but still the logs are written to the eclipse consoled. Can anyone help here ?
来源:https://stackoverflow.com/questions/57336317/zookeeper-not-logging-as-per-directory-path-in-log4j