--- id: logging title: "Logging" --- Apache Druid processes will emit logs that are useful for debugging to the console. Druid processes also emit periodic metrics about their state. For more about metrics, see [Configuration](../configuration/index.md#enabling-metrics). Metric logs are printed to the console by default, and can be disabled with `-Ddruid.emitter.logging.logLevel=debug`. Druid uses [log4j2](http://logging.apache.org/log4j/2.x/) for logging. The default configuration file log4j2.xml ships with Druid under conf/druid/{config}/_common/log4j2.xml . By default, Druid uses `RollingRandomAccessFile` for rollover daily, and keeps log files up to 7 days. If that's not suitable in your case, you could modify the log4j2.xml to meet your need. An example log4j2.xml file is shown below: ``` ``` ## How to change log directory By default, Druid outputs the logs to a directory `log` under the directory where Druid is launched from. For example, if Druid is started from its `bin` directory, there will be a subdirectory `log` generated under `bin` directory to hold the log files. If you want to change the log directory, set environment variable `DRUID_LOG_DIR` to the right directory before you start Druid. ## My logs are really chatty, can I set them to asynchronously write? Yes, using a `log4j2.xml` similar to the following causes some of the more chatty classes to write asynchronously: ``` ```