summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_logs_filter_dynamic.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@sullrich-MacBookPro.local>2009-03-31 22:28:54 -0400
committerScott Ullrich <sullrich@sullrich-MacBookPro.local>2009-03-31 22:28:54 -0400
commit568f30c2f897bffd08df28abb74b74cc2d8be2ad (patch)
tree03e29b24c6e73cf37cbfe979538f79a1b491625e /usr/local/www/diag_logs_filter_dynamic.php
parentb24358d1aceeca7846f8cb370ef22b9d11156011 (diff)
downloadpfsense-568f30c2f897bffd08df28abb74b74cc2d8be2ad.zip
pfsense-568f30c2f897bffd08df28abb74b74cc2d8be2ad.tar.gz
Switch back to clog but leave option to run fifolog.
Diffstat (limited to 'usr/local/www/diag_logs_filter_dynamic.php')
-rwxr-xr-xusr/local/www/diag_logs_filter_dynamic.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php
index bf68e43..ec70856 100755
--- a/usr/local/www/diag_logs_filter_dynamic.php
+++ b/usr/local/www/diag_logs_filter_dynamic.php
@@ -48,17 +48,18 @@ if (!$nentries)
handle_ajax();
if ($_POST['clear']) {
+ exec("/usr/bin/killall syslogd");
if(isset($config['system']['disablesyslogclog'])) {
unlink("/var/log/filter.log");
touch("/var/log/filter.log");
- } else {
-// exec("killall syslogd");
-// sleep(1);
-// if(file_exists("{$filter_logfile}")
-// unlink("{$filter_logfile}");
- exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
- exec("/usr/bin/killall -HUP syslogd");
+ } else {
+ if(isset($config['system']['usefifolog'])) {
+ exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
+ } else {
+ exec("/usr/sbin/clog -i -s 262144 {$filter_logfile}");
+ }
}
+ system_syslogd_start();
}
/* format filter logs */
@@ -74,7 +75,10 @@ function conv_clog_filter($logfile, $tail = 50) {
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
$logarr = "";
- exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ else
+ exec("/usr/sbin/clog {$logfile} | grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr);
$filterlog = array();
@@ -87,7 +91,6 @@ function conv_clog_filter($logfile, $tail = 50) {
$log_split = "";
-
preg_match("/(\b(?:\d{1,3}\.){3}\d{1,3}(\.\w+)?)\s.*\s(\b(?:\d{1,3}\.){3}\d{1,3}(\.\w+)?)/", $logent, $log_split);
$flent['src'] = convert_port_period_to_colon($log_split[1]);
OpenPOWER on IntegriCloud