Revision 1982ad48
Added by Colin Smith about 20 years ago
usr/local/www/diag_logs.php | ||
---|---|---|
44 | 44 |
exec("/usr/sbin/clog -i -s 262144 {$system_logfile}"); |
45 | 45 |
} |
46 | 46 |
|
47 |
function dump_clog($logfile, $tail, $withorig = true) { |
|
48 |
global $g, $config; |
|
49 |
|
|
50 |
$sor = isset($config['syslog']['reverse']) ? "-r" : ""; |
|
51 |
|
|
52 |
exec("/usr/sbin/clog {$logfile} | /usr/bin/grep -v racoon | /usr/bin/tail {$sor} -n {$tail}", $logarr); |
|
53 |
|
|
54 |
foreach ($logarr as $logent) { |
|
55 |
$logent = preg_split("/\s+/", $logent, 6); |
|
56 |
echo "<tr valign=\"top\">\n"; |
|
57 |
|
|
58 |
if ($withorig) { |
|
59 |
echo "<td class=\"listlr\" nowrap>" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "</td>\n"; |
|
60 |
echo "<td class=\"listr\">" . htmlspecialchars($logent[4] . " " . $logent[5]) . "</td>\n"; |
|
61 |
} else { |
|
62 |
echo "<td class=\"listlr\" colspan=\"2\">" . htmlspecialchars($logent[5]) . "</td>\n"; |
|
63 |
} |
|
64 |
echo "</tr>\n"; |
|
65 |
} |
|
66 |
} |
|
67 |
|
|
68 | 47 |
?> |
69 | 48 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
70 | 49 |
<html> |
... | ... | |
96 | 75 |
<td colspan="2" class="listtopic"> |
97 | 76 |
Last <?=$nentries;?> system log entries</td> |
98 | 77 |
</tr> |
99 |
<?php dump_clog($system_logfile, $nentries); ?> |
|
78 |
<?php dump_clog($system_logfile, $nentries, "racoon", true); ?>
|
|
100 | 79 |
</table> |
101 | 80 |
<br><form action="diag_logs.php" method="post"> |
102 | 81 |
<input name="clear" type="submit" class="formbtn" value="Clear log"> |
Also available in: Unified diff
Remove dump_clog.