This extension for the default FileHandler can rotate log files like the Linux Logrotate command.
We provide a VI package (*.vip) to be installed with the JKI VI Package Manager. The commercial package can be downloaded by authorized people on our Log Rotate Handler release page.
The Create LogRotate
method takes a cluster LogRotate Configuration
for all specific options.
Cluster LogRotate Configuration
:
n
rotations, there will be n
additional files to the log file. If Rotations is 0
, no file with the content of the previous period will be created.0
, the log file will not be rotated by file size.None
: No rotation by period.Instant (for testing)
: The file will be rotated instantly with every log event. This case is intended for testing only.hourly
: The log file will be rotated on every full hour.daily
: The log file will be rotated on every new day.weekly
: The log file will be rotated on every new week.monthly
: The log file will be rotated on every new month.$INPUT
contains the file path of the rotated log file and the variable $OUTPUT
the file path of the compressed output file. Do _not_ enclose these variables in quotes, this is done automatically. $INPUT
is mandatory, $OUTPUT
not, it depends on the program whether you need it. See examples below..log
for the log file. Otherwise, it will throw an error after the second log.
The initialization is the same as for other Log-Handler. Use the method Create LogRotateFileHandler.vi
to instantiate a new LogRotate-Handler and configure it. Then wire the object together with other Log-Handlers, if applicable, as array to the Init Loggin
method.
7-Zip on Windows with zip file format:
“C:\Program Files\7-Zip\7z.exe” a -tzip $OUTPUT $INPUT
GZip on Linux:
gzip “$INPUT”