Browse Source

Merge pull request #1303 from 31z4/zookeeper

Document logging dir config in Zookeeper
Tianon Gravi 7 years ago
parent
commit
8027a4da33
1 changed files with 12 additions and 0 deletions
  1. 12 0
      zookeeper/content.md

+ 12 - 0
zookeeper/content.md

@@ -113,3 +113,15 @@ In 3.5, the syntax of this has changed. Servers should be specified as such: `se
 This image is configured with volumes at `/data` and `/datalog` to hold the Zookeeper in-memory database snapshots and the transaction log of updates to the database, respectively.
 
 > Be careful where you put the transaction log. A dedicated transaction log device is key to consistent good performance. Putting the log on a busy device will adversely affect performance.
+
+## How to configure logging
+
+By default, ZooKeeper redirects stdout/stderr outputs to the console. You can redirect to a file located in `/logs` by passing environment variable `ZOO_LOG4J_PROP` as follows:
+
+```console
+$ docker run --name some-zookeeper --restart always -e ZOO_LOG4J_PROP="INFO,ROLLINGFILE" zookeeper
+```
+
+This will write logs to `/logs/zookeeper.log`. Check [ZooKeeper Logging](http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_logging) for more details.
+
+This image is configured with a volume at `/logs` for your convenience.