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.
To change the frequency:
Open the
/etc/knox/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:Table 9.1. Audit Log Settings: Roll Frequency
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. Tip For more examples, see Apache log4j: Class DailyRollingFileAppender.
Save the file.
Restart the gateway:
su -l knox -c '$gateway_home/bin/gateway.sh stop' su -l knox -c '$gateway_home/bin/gateway.sh start'