Configuring daily log rotation

This topic describes how to configure the Agent log for daily rotation.

By default, the Dgraph HDFS Agent log does not support daily rotation. However, you can modify the log4j.properties file for this feature.

To configure the Dgraph HDFS Agent log for daily rotation.

  1. Open the log4j.properties file in a text editor.
  2. Add the following line to the file:
    log4j.appender.ROLLINGFILE.RotationFrequency=1440
  3. Remove these two lines:
    log4j.appender.ROLLINGFILE.MaxSegmentSize=10485760
    log4j.appender.ROLLINGFILE.MaxSize=1048576000
  4. Save the file.
  5. Re-start the Dgraph HDFS Agent:
    ./bdd-admin.sh restart -c agent
Keep in mind that you can force rotate the logs by running the bdd-admin script with the rotate-logs command, as in this example:
./bdd-admin.sh rotate-logs -c agent -n web009.us.example.com

As a result of this example, the dgraphHDFSAgent.out log is renamed to dgraphHDFSAgent.out-1438022767 and an empty dgraphHDFSAgent.out log is created.

For information on the rotate-logs command, see the Administrator's Guide.