On Fedora 8, use rsyslog by default instead of syslog.
---- Changes since 1.430 ----
Added support for rsyslogd, as seen by default on Debian 5.0.
+---- Changes since 1.480 ----
+Rsyslog format tags in the config file are now recogized and preserved, rather than being included in the log filename.
else {
&can_edit_log($log) || &error($text{'save_ecannot4'});
$old = $conf->[$in{'idx'}];
+ $log->{'format'} = $old->{'format'}; # Copy for now
&can_edit_log($old) || &error($text{'save_ecannot5'});
&update_log($old, $log);
}
if ($line =~ /^\$(\S+)\s*(\S*)/) {
# rsyslog special directive - ignored for now
}
+ elsif ($line =~ /^if\s+/) {
+ # rsyslog if statement .. ignored too
+ }
elsif ($line =~ /^(#*)\s*([^#\s]+\.\S+)\s+(\S+)$/ ||
$line =~ /^(#*)\s*([^#\s]+\.\S+)\s+(\|.*)$/) {
# Regular log destination
$log->{'index'} = scalar(@rv);
$log->{'section'} = $tag;
$tag->{'eline'} = $lnum;
+ if ($log->{'file'} =~ s/^(\/\S+);(\S+)$/$1/ ||
+ $log->{'pipe'} =~ s/^(\/\S+);(\S+)$/$1/) {
+ # rsyslog file format
+ $log->{'format'} = $2;
+ }
push(@rv, $log);
}
elsif ($line =~ /^(#?)!(\S+)$/) {
else {
$d = '*';
}
+if ($_[0]->{'format'}) {
+ # Add rsyslog format
+ $d .= ";".$_[0]->{'format'};
+ }
return ($_[0]->{'active'} ? "" : "#").join(";", @{$_[0]->{'sel'}})."\t".$d;
}