cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to logrotate neo4j.log file

The neo4j.log file is a redirection to STDOUT. When you implement a default logrotate strategy,
Neo4j will not be able to write to that file anymore after a rotation.

Solution

You can use "copytruncate" in your logrotate configuration file.

Example Logrotate Configuration

/usr/local/neo4j/logs/neo4j.log {
	su neo4j neo4j
	copytruncate
	rotate 4
	daily
	compress
	missingok
	notifempty
}

Note :

There is a very small time slice between copying the file and truncating it, so
some logging data might be lost. When this option is used, the create option will
have no effect, as the old log file stays in place.

References

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online