diff --git a/zookeeper/content.md b/zookeeper/content.md index 8f5fcff68..81bd4351b 100644 --- a/zookeeper/content.md +++ b/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.