Log rotation is an automated process in system administration that manages log files by compressing, archiving, renaming, or deleting them once they become too old or too large (other metrics may also apply).
The main purpose of log rotation is to manage the volume of log file data, preventing the record store from overflowing while keeping the log files small enough to be easily viewed.
This functionality has been available starting from quilliup version 2.7.0.
Follow the next steps:
- Go to the "..\quilliup\webapps\ROOT\utils\Log_rotate" folder, it should contain the following folders and files:
- The "logrotate.conf" configuration file, located in the "Content" folder, defines how log files should be rotated and managed.
"logrotate.conf" file can be customized, for example:
Note: make sure to set the correct path to the log files (in upper example - "C:\Program Files\quilliup\logs").
The following link references the official LogRotate documentation: https://sourceforge.net/p/logrotatewin/wiki/LogRotate/
Once all the configurations are set in the "logrotate.conf" file, the log rotation can be performed using the "execute_rotation_and_move.bat" file.
However, if you prefer to perform these actions separately, you can use the Logrotate.bat file for log rotation and the move.bat file for file movement.
execute_rotation_and_move.bat - The batch file automates the periodic rotation and archiving of log files. It renames the log files with a timestamp for better organization and then moves them to a designated folder for storage.
Logrotate.bat - The batch file initiates the log rotation process using a configuration file.
In execute_rotation_and_move.bat (this is relevant for logrotate.bat as well) Change both paths according to your environment:
1. The first path is the path of the logrotate.exe file
2. The second path is the logrotate.conf path
To define the location of the rotated logs, change the path according to your environment (this is relevant for move.bat as well):
In addition, there is an option to schedule a log rotation using Windows Task Manager:
- Open the Task Scheduler utility by going to Start > All Programs > Accessories > System Tools > Task Scheduler.
- In the Task Scheduler window, click on the "Create Basic Task" option in the Actions pane.
- Follow the prompts to create a new task. When asked to specify the trigger for the task, choose the "Daily" option and set the task to run at the frequency you want (e.g. every day, every week, etc.).
- When asked to specify the action for the task, choose the "Start a program" option and specify the path to the Logrotate.bat file in the logRotate folder.
- Follow the prompts to complete the task creation process.
Comments
0 comments
Please sign in to leave a comment.