Two grb_rs.cnf configuration properties control the rotation of log files:
-
LOGFILE_MAX_SIZE
is the maximum size in megabytes of the log file before it gets rotated. The default is 500 megabytes. -
LOGFILE_MAX_AGE
is the maximum number of days to retain old log files based on the timestamp encoded in their filename. Note that a day is defined as 24 hours and may not exactly correspond to calendar days due to daylight savings, leap seconds, etc. The default is 5 days.
Example
- Set the limit to 1 MB via
LOGFILE_MAX_SIZE=1
. - Store the log to
grb.log
.
$ ls -lia *.log
8610858073 -rw-r--r-- 1 me staff 1048562 Apr 3 21:31 grb-2019-04-04T04-31-38.919.log
8610859576 -rw-r--r-- 1 me staff 1048528 Apr 3 21:32 grb-2019-04-04T04-32-03.160.log
8610860698 -rw-r--r-- 1 me staff 1048517 Apr 3 21:32 grb-2019-04-04T04-32-24.813.log
8610861797 -rw-r--r-- 1 me staff 1048537 Apr 3 21:32 grb-2019-04-04T04-32-43.304.log
8610862909 -rw-r--r-- 1 me staff 1048548 Apr 3 21:33 grb-2019-04-04T04-33-00.566.log
8610863994 -rw-r--r-- 1 me staff 1048528 Apr 3 21:33 grb-2019-04-04T04-33-19.940.log
8610865078 -rw-r--r-- 1 me staff 153301 Apr 3 21:33 grb.log
The most recent log will always be in grb.log
. When the grb.log
file reaches the maximum size, it will be moved to a name with a timestamp with the same prefix, and a new and empty grb.log
is then used. Finally, the maximum age property controls how long to keep these log files with timestamps. When a new file is needed, and there is a file that is older than the maximum age, that old file will be deleted.
Comments
0 comments
Article is closed for comments.