Knowledge Base

How do i configure Neo4j so that data/graph.db/messages.log is automatically rotated

As tested and verified with Neo4j 2.3.0, the data/graph.db/messages.log, its size and number of rotated archives is governed by the following parameters in the conf/neo4j.properties file

Name Description Default

store.internal_log.max_archives

Maximum number of history files for the internal log.

7

store.internal_log.rotation_threshold

Threshold for rotation of the internal log.

20MB

With the above default parameters one should expect to see no data/graph.db/messages.log exceed 20MB and we will keep up to 7 archives, namely data/graph.db/messages.log.1, data/graph.db/messages.log.2 …​ data/graph.db/messages.log.7.

If you wish to change the defaults the conf/neo4j.properties file would need to include the new values for

store.internal_log.max_archives=<N number of archives>

store.internal_log.rotation_threshold=<# of bytes before the file is rotated>

and then issue a bin/neo4j restart for the new parameters to take effect.

Prior to 2.3.0 one would need to use the linux built in functionality of logrotate