Change Roll Frequency of the Audit Log
Audit records are written to the log file /var/log/knox/gateway-audit.log and by default roll monthly. When the log rolls, the date that it rolled is appended to the end of the current log file and a new one is created.
-
Open the
$gatewaydir/conf/gateway-log4j.properties
file in a text editor. -
Change the
log4j.appender.auditfile.DatePattern
as follows:log4j.appender.auditfile.DatePattern = $interval
.Where
$interval
is one of the following:Setting
Description
yyyy-MM
Rollover at the beginning of each month
yyyy-ww
Rollover at the first day of each week. The first day of the week depends on the locale.
yyyy-MM-dd
Rollover at midnight each day.
yyyy-MM-dd-a
Rollover at midnight and midday of each day.
yyyy-MM-dd-HH
Rollover at the top of every hour.
yyyy-MM-dd-HH-mm
Rollover at the beginning of every minute.
TipFor more examples, see “Apache log4j: Class DailyRollingFileAppender”.
- Save the file.
- Restart the gateway:
cd $gateway bin/gateway.sh stop bin/gateway.sh start
.