summaryrefslogtreecommitdiffstats
path: root/usr/local/www/guiconfig.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-12-26 15:25:46 -0500
committerjim-p <jimp@pfsense.org>2013-12-26 15:27:40 -0500
commitc7a3356e6bfb67b1b617eaeddd5983ddae901759 (patch)
treee09ecd7c88d121c9c3559dc9fb39de73a9b87f8f /usr/local/www/guiconfig.inc
parent7b03748b37503e11fcb92075a375305fb06c9366 (diff)
downloadpfsense-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 'usr/local/www/guiconfig.inc')
-rwxr-xr-xusr/local/www/guiconfig.inc26
1 files changed, 22 insertions, 4 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index d5a9cf7..1997ac5 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -543,19 +543,37 @@ function update_changedesc($update) {
$changecount++;
}
-function clear_log_file($logfile = "/var/log/system.log") {
+function clear_log_file($logfile = "/var/log/system.log", $restart_syslogd = true) {
global $config, $g;
- exec("/usr/bin/killall syslogd");
+ if ($restart_syslogd)
+ exec("/usr/bin/killall syslogd");
if(isset($config['system']['disablesyslogclog'])) {
unlink($logfile);
touch($logfile);
} else {
+ $log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "511488";
if(isset($config['system']['usefifolog']))
- exec("/usr/sbin/fifolog_create -s 511488 {$logfile}");
+ exec("/usr/sbin/fifolog_create -s {$log_size} {$logfile}");
else
- exec("/usr/sbin/clog -i -s 511488 {$logfile}");
+ exec("/usr/sbin/clog -i -s {$log_size} {$logfile}");
+ }
+ if ($restart_syslogd)
+ system_syslogd_start();
+}
+
+function clear_all_log_files() {
+ global $g;
+ exec("/usr/bin/killall syslogd");
+
+ $log_files = array("system", "filter", "dhcpd", "vpn", "pptps", "poes", "l2tps", "openvpn", "portalauth", "ipsec", "ppp", "relayd", "wireless", "lighttpd", "ntpd", "gateways", "resolver", "routing");
+ foreach ($log_files as $lfile) {
+ clear_log_file("{$g['varlog_path']}/{$lfile}.log", false);
}
+
system_syslogd_start();
+ killbyname("dhcpd");
+ services_dhcpd_configure();
+ return;
}
function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") {
OpenPOWER on IntegriCloud