How can I manage/rotate/delete my PrizmDoc log files?
A common approach to log file management on Linux is the use of logrotate
. While there is no native Windows equivalent of logrotate
, the same functionality can be achieved through the use of a third-party application.
Below is an annotated configuration file for logrotate
which can be configured to your preferences. Simply add the configuration below to your system's logrotate
configuration file and your system will automatically manage your PrizmDoc log files. This configuration can also be extended by using the prerotate
and postrotate
options to add custom script execution to your regular rotation.
# Configuration File Location:
# ============================
#
# Linux: /etc/logrotate.conf
# Windows: C:/Program Files (x86)/LogRotate/Content/logrotate.conf
# (After installing [logrotatewin](https://sourceforge.net/projects/logrotatewin/).)
#
# PRIZMDOC LOGROTATE CONFIGURATION
# ================================
#
# By default, PrizmDoc logs are located on Linux at:
#
# /usr/share/prizm/logs/*
#
# and on Windows at:
#
# C:/Prizm/logs/*
#
# For Windows, change the file paths below accordingly.
#
/usr/share/prizm/logs/*.log
/usr/share/prizm/logs/**/*.log {
# Rotate logs once per day. Available options are daily, weekly, monthly, and yearly.
daily
# If no *.log files are found, don't freak out
missingok
# Keep 14 files before deleting old log files (That's a default of 2 weeks of logs.)
rotate 14
# Compress (gzip) log files
compress
# Don't rotate empty files
notifempty
# Run postrotate script after all logs are rotated. If this is not set, it will run postrotate after each matching file is rotated.
sharedscripts
# Script to run before rotation is done.
prerotate
echo "Pre-Rotate"
endscript
# Script to run after rotation is done.
postrotate
echo "Post-Rotate"
endscript
}
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article