diff options
author | jim-p <jimp@pfsense.org> | 2013-12-26 15:25:46 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-12-26 15:27:40 -0500 |
commit | c7a3356e6bfb67b1b617eaeddd5983ddae901759 (patch) | |
tree | e09ecd7c88d121c9c3559dc9fb39de73a9b87f8f /etc | |
parent | 7b03748b37503e11fcb92075a375305fb06c9366 (diff) | |
download | pfsense-c7a3356e6bfb67b1b617eaeddd5983ddae901759.zip pfsense-c7a3356e6bfb67b1b617eaeddd5983ddae901759.tar.gz |
Add a setting to allow the user to specify the clog file size so more (or less) entries may be kept in the raw logs. Retain previous default size values if the user has not specified a preferred size. Files can only be resized when initialized, so provide a "Reset All Logs" button as well to force clear all logs and set them up at the new size.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/system.inc | 4 | ||||
-rwxr-xr-x | etc/rc | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 4761fba..1dfbeb7 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -627,11 +627,11 @@ function system_syslogd_start() { $log_size = ""; } else if (isset($config['system']['usefifolog'])) { $log_directive = "|/usr/sbin/fifolog_writer "; - $log_size = "10240"; + $log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "10240"; $log_create_directive = "/usr/sbin/fifolog_create -s "; } else { // Defaults to CLOG $log_directive = "%"; - $log_size = "10240"; + $log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "10240"; $log_create_directive = "/usr/sbin/clog -i -s "; } @@ -301,6 +301,12 @@ echo -n "." DISABLESYSLOGCLOG=`/usr/bin/grep -c disablesyslogclog /cf/conf/config.xml` ENABLEFIFOLOG=`/usr/bin/grep -c usefifolog /cf/conf/config.xml` LOG_FILES="system filter dhcpd vpn pptps poes l2tps openvpn portalauth ipsec ppp relayd wireless lighttpd ntpd gateways resolver routing" + +DEFAULT_LOG_FILE_SIZE=`/usr/local/bin/xmllint --xpath 'string(//pfsense/syslog/logfilesize)' /conf/config.xml` +if [ ! ${DEFAULT_LOG_FILE_SIZE} ]; then + DEFAULT_LOG_FILE_SIZE=511488 +fi + for logfile in $LOG_FILES; do if [ "$DISABLESYSLOGCLOG" -gt "0" ]; then /usr/bin/touch /var/log/$logfile.log @@ -308,9 +314,9 @@ for logfile in $LOG_FILES; do if [ ! -f /var/log/$logfile.log ]; then if [ "$ENABLEFIFOLOG" -gt "0" ]; then # generate fifolog files - /usr/sbin/fifolog_create -s 511488 /var/log/$logfile.log + /usr/sbin/fifolog_create -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log else - /usr/sbin/clog -i -s 512144 /var/log/$logfile.log + /usr/sbin/clog -i -s ${DEFAULT_LOG_FILE_SIZE} /var/log/$logfile.log fi fi fi |