24.5. Logical logs
Logical logs in Neo4j are the journal of which operations happens and are the source of truth in scenarios where the database needs to be recovered after a crash or similar. Logs are rotated every now and then (defaults to when they surpass 25 Mb in size) and the amount of legacy logs to keep can be configured. Purpose of keeping a history of logical logs include being able to serve incremental backups as well as keeping an HA cluster running.
For any given configuration at least the latest non-empty logical log will be kept, but configuration can be supplied to control how much more to keep. There are several different means of controlling it and the format in which configuration is supplied is:
keep_logical_logs=<true/false> keep_logical_logs=<amount> <type>
# Will keep logical logs indefinitely keep_logical_logs=true # Will keep only the most recent non-empty log keep_logical_logs=false # Will keep logical logs which contains any transaction committed within 30 days keep_logical_logs=30 days # Will keep logical logs which contains any of the most recent 500 000 transactions keep_logical_logs=500k txs
Number of most recent logical log files to keep
Max disk size to allow log files to occupy
"300M size" or "1G size"
Number of latest transactions to keep Keep
"250k txs" or "5M txs"
Keep logs which contains any transaction committed within N hours from current time
Keep logs which contains any transaction committed within N days from current time