summaryrefslogtreecommitdiffstats
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
parentb24358d1aceeca7846f8cb370ef22b9d11156011 (diff)
downloadpfsense-568f30c2f897bffd08df28abb74b74cc2d8be2ad.zip
pfsense-568f30c2f897bffd08df28abb74b74cc2d8be2ad.tar.gz
Switch back to clog but leave option to run fifolog.
-rwxr-xr-xusr/local/www/diag_logs_filter.php17
-rwxr-xr-xusr/local/www/diag_logs_filter_dynamic.php21
-rwxr-xr-xusr/local/www/diag_logs_vpn.php17
-rwxr-xr-xusr/local/www/status.php11
4 files changed, 40 insertions, 26 deletions
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index b79106f..9b67549 100755
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -56,16 +56,16 @@ if (!$nentries)
$nentries = 50;
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");
+ if(isset($config['system']['usefifolog'])) {
+ exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
+ } else {
+ exec("/usr/sbin/clog -i -s 262144 {$filter_logfile}");
+ }
}
}
@@ -81,7 +81,10 @@ function conv_clog($logfile, $tail = 50) {
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
- exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n 500", $logarr);
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n 500", $logarr);
+ else
+ exec("/usr/sbin/clog {$logfile} | grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n 500", $logarr);
$filterlog = array();
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]);
diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php
index 939884b..ba21924 100755
--- a/usr/local/www/diag_logs_vpn.php
+++ b/usr/local/www/diag_logs_vpn.php
@@ -45,16 +45,15 @@ if (!$nentries)
$nentries = 50;
if ($_POST['clear']) {
+ exec("/usr/bin/killall syslogd");
if(isset($config['system']['disablesyslogclog'])) {
unlink("/var/log/vpn.log");
touch("/var/log/vpn.log");
} else {
-// exec("killall syslogd");
-// sleep(1);
-// if(file_exists("/var/log/vpn.log"))
-// unlink("/var/log/vpn.log");
- exec("/usr/sbin/fifolog_create -s 50688 /var/log/vpn.log");
- exec("/usr/bin/killall -HUP syslogd");
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_create -s 50688 /var/log/vpn.log");
+ else
+ exec("/usr/sbin/clog -i -s 262144 /var/log/vpn.log");
}
/* redirect to avoid reposting form data on refresh */
header("Location: diag_logs_vpn.php");
@@ -67,7 +66,11 @@ function dump_clog_vpn($logfile, $tail) {
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
$logarr = "";
- exec("/usr/sbin/fifolog_reader " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
+
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_reader " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
+ else
+ exec("/usr/sbin/clog " . $logfile . " | grep -v \"CLOG\" | grep -v \"\033\" | tail {$sor} -n " . $tail, $logarr);
foreach ($logarr as $logent) {
$logent = preg_split("/\s+/", $logent, 6);
diff --git a/usr/local/www/status.php b/usr/local/www/status.php
index 3b0e320..2e5fd63 100755
--- a/usr/local/www/status.php
+++ b/usr/local/www/status.php
@@ -172,9 +172,14 @@ defCmdT("racoon.conf","cat /var/etc/racoon.conf");
defCmdT("SPD","/sbin/setkey -DP");
defCmdT("SAD","/sbin/setkey -D");
-defCmdT("last 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
-defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
-
+if(isset($config['system']['usefifolog'])) {
+ defCmdT("last 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
+ defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
+} else {
+ defCmdT("last 200 system log entries","/usr/sbin/clog /var/log/system.log 2>&1 | tail -n 200");
+ defCmdT("last 50 filter log entries","/usr/sbin/clog /var/log/filter.log 2>&1 | tail -n 50");
+}
+
defCmd("ls /conf");
defCmd("ls /var/run");
OpenPOWER on IntegriCloud