From c55025096e3b4f78280ab06e79a4537273375e7d Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 11 Aug 2015 20:08:06 +0200 Subject: syslog-ng - code style fixes - Fix copyright header - Code style and indentation fixes - Valid XHTML --- config/syslog-ng/syslog-ng_log_viewer.php | 114 +++++++++++++++--------------- 1 file changed, 58 insertions(+), 56 deletions(-) (limited to 'config/syslog-ng') diff --git a/config/syslog-ng/syslog-ng_log_viewer.php b/config/syslog-ng/syslog-ng_log_viewer.php index c8183f14..c914110a 100644 --- a/config/syslog-ng/syslog-ng_log_viewer.php +++ b/config/syslog-ng/syslog-ng_log_viewer.php @@ -1,37 +1,32 @@ 0)) { +if (file_exists($logfile) && (filesize($logfile) > 0)) { $grep = "grep -ih"; - - if(($compress_archives == 'on') && glob($logfile . "*" . $compress_type) && $archives) { + + if (($compress_archives == 'on') && glob($logfile . "*" . $compress_type) && $archives) { if($compress_type == 'bz2') { $grep = "bzgrep -ih"; } else { $grep = "zgrep -ih"; } } - - if(isset($filter) && $not) { + + if (isset($filter) && $not) { $grepcmd = "$grep -v '$filter' $logfile"; } else { $grepcmd = "$grep '$filter' $logfile"; } - - if($archives) + + if ($archives) { $grepcmd = $grepcmd . "*"; - + } + $log_lines = trim(shell_exec("$grepcmd | wc -l")); $log_output = trim(shell_exec("$grepcmd | sort -M | tail -n $limit")); - - if(!empty($log_output)) { + + if (!empty($log_output)) { $log_messages = explode("\n", $log_output); $log_messages_count = sizeof($log_messages); } @@ -92,7 +93,7 @@ if(file_exists($logfile) && (filesize($logfile) > 0)) { $pgtitle = "Services: Syslog-ng Log Viewer"; include("head.inc"); -?> +?> @@ -107,11 +108,11 @@ include("head.inc"); display_top_tabs($tab_array); ?> - +
- +
- + \n"; - foreach($log_messages as $log_message) { + foreach($log_messages as $log_message) { echo "\n"; } } else { @@ -156,7 +157,7 @@ include("head.inc");
Log FileShowing $log_messages_count of $log_lines messages
$log_message
Inverse Filter (NOT) />
- +
@@ -164,4 +165,5 @@ include("head.inc"); - \ No newline at end of file + + -- cgit v1.2.3