First version of this module.
---- Changes since 1.270 ----
Error logs from Webmin and Usermin, and kernel messages are now viewable in this module.
+---- Changes since 1.500 ----
+Speed up the un-filtered display of the last N lines of a log file, by just running tail on it directly.
else {
# Not filtering .. so cat the most recent non-empty file
if ($cmd) {
- $catter = $cmd;
+ # Getting output from a command
+ $fullcmd = $cmd." | ".$tailcmd;
}
- else {
+ elsif ($config{'compressed'}) {
+ # Find the first non-empty file, newest first
$catter = "cat ".quotemeta($file);
- if (!-s $file && $config{'compressed'}) {
+ if (!-s $file) {
foreach $l (&all_log_files($file)) {
next if (!-s $l);
$c = &catter_command($l);
}
}
}
+ $fullcmd = $catter." | ".$tailcmd;
+ }
+ else {
+ # Just run tail on the file
+ $fullcmd = $tailcmd." ".quotemeta($file);
}
$got = &foreign_call("proc", "safe_process_exec",
- $catter." | $tailcmd",
- 0, 0, STDOUT, undef, 1, 0, undef, 1);
+ $fullcmd, 0, 0, STDOUT, undef, 1, 0, undef, 1);
}
print "<i>$text{'view_empty'}</i>\n" if (!$got);
print "</pre>\n";
Rsyslog format tags in the config file are now recogized and preserved, rather than being included in the log filename.
---- Changes since 1.490 ----
Added support for rsyslog IncludeConfig directives, which are used to split the config into multiple files, as seen on Ubuntu 9.
+---- Changes since 1.500 ----
+Speed up the un-filtered display of the last N lines of a log file, by just running tail on it directly.
# Not filtering .. so cat the most recent non-empty file
if ($cmd) {
# Getting output from a command
- $catter = $cmd;
+ $fullcmd = $cmd." | ".$tailcmd;
}
- else {
+ elsif ($config{'compressed'}) {
# Find the first non-empty file, newest first
$catter = "cat ".quotemeta($file);
- if (!-s $file && $config{'compressed'}) {
+ if (!-s $file) {
foreach $l (reverse(&all_log_files($file))) {
next if (!-s $l);
$c = &catter_command($l);
}
}
}
+ $fullcmd = $catter." | ".$tailcmd;
+ }
+ else {
+ # Just run tail on the file
+ $fullcmd = $tailcmd." ".quotemeta($file);
}
$got = &foreign_call("proc", "safe_process_exec",
- $catter." | $tailcmd",
- 0, 0, STDOUT, undef, 1, 0, undef, 1);
+ $fullcmd, 0, 0, STDOUT, undef, 1, 0, undef, 1);
}
print "<i>$text{'view_empty'}</i>\n" if (!$got);
print "</pre>\n";