Last active Mar 26, 2017

HowTo Rotate Dash Log Files

Dash Masternodes use several log files. In particular, debug.log, and in many configurations, sentinel.log.
Letting these log files grow indefinitely is not wise. Additionally, imagine if your Masternode is DDOS
attacked. One aspect of a DDOS attack is that your Masternode may fill up diskspace with log messaging.

Linux sytems fortunately give you a really simple method of ensuring those log file sizes don't get out of hand.

What log rotation does is periodically, based on rules, copy the log file to a new name, and compress it for archival
purposes and zero out the original file. It will do this periodically keeping only a fixed number of copies.

Note2: If you installed your Dash Masternode via the methods and packaging provided at
https://github.com/taw00/dashcore-rpm and run dashd as a systemd enabled service, you have no further action
to take. Managing your log files has already been done for you....for all the rest of you, continue reading...

What you need to configure your system...

Your username or the username of the owner of the Dash Core datadir. For example, for me, t0dd

That configuration, will rotate the listed log files, up to 5 saved and compressed archives each, and archives them only if they go over 50MB in size (and 100k for Sentinel).

Note: 50M and 100k are arbitrary. A typical day yields debug.log files of 3 to 5MB in size and sentinel.log files of neglible size, so you should see only 1 or 2 rotations per week. 5M, or 10M, or even 500M for the debug.log files is fine dependent on how much you want to preserve.

Let's check every hour instead of every day...

Logrotate automatically runs by default once per day. Forcing it to run every hour or every 30 minutes
will really help if your log files are at risk of exploding in size due to an anomalous event, like, for example, a DDOS attack.