readme: log file section

This commit is contained in:
Asif Bacchus 2018-10-19 05:46:51 -06:00
parent 4211b2e29c
commit e166086f91
1 changed files with 39 additions and 0 deletions

View File

@ -417,3 +417,42 @@ easiest with a simple cron job.
sudo crontab -l
```
## The log file
The script creates a very detailed log file of all major operations along with
any errors and warnings. Everything is timestamped so you can see how long
things take and when any errors tooks place. The script includes debugging
notes such as where temp files are located, where it's looking for data, whether
it created/moved/copied files, etc. All major operations are tagged *'-- [INFO]
message here --'*. Similarily, warnings are tagged *'-- [WARNING] message here
(code: xxxx) --'* and errors are tagged *'-- [ERROR] message here (code: xxx)
--'*. Successful operations generate a *'-- [SUCCESS] message here --'* stamp.
This tagging makes it easy for you to set up a log screening program to make
keeping an eye on your backup results easier. If you plan on using Logwatch
(highly recommended, great program!) then I've done the work for you...
### Using Logwatch
Log-group, conf and service files are included so that you can easily setup
Logwatch to monitor the script's log file and report at your desired detail
level as follows:
1. 0: Summary of total success, warnings & errors only
2. 1-4: Actual success, error & warning messages
3. 5: Same as above, but includes info messages
4. 6+: Dumps entire raw log file including debugging messages
A detailed breakdown of the files and all options are included in a separate
readme in the *'/etc/logwatch'* folder of this git archive.
### Remember to rotate your logs!
The log file generated by this script is fairly detailed so it can grow quite
large over time. This is especially true if you are using verbose output from
borg for any troubleshoot or for compliance/auditing. I've included a sample
commented logrotate config file in this git archive at *'/etc/logrotate.d'*
which you can modify and drop into that same directory on your Debian/Ubuntu
system. If you are using another log rotating solution, then please remember to
configure it so that your log files don't get overwhelmingly large should you
need to parse them if something goes wrong with your backups.