PacketFence - BTS - PacketFence | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0000136 | PacketFence | public | 2006-10-18 15:17 | 2008-09-19 12:43 | ||||||
Reporter | bruce | |||||||||
Assigned To | user4 | |||||||||
Priority | normal | Severity | feature | Reproducibility | always | |||||
Status | closed | Resolution | fixed | |||||||
Platform | OS | OS Version | ||||||||
Product Version | ||||||||||
Target Version | Fixed in Version | |||||||||
fixed in git revision | ||||||||||
fixed in mtn revision | ||||||||||
Summary | 0000136: Logging enhancement to send stdout to syslog etc | |||||||||
Description | Here is a patch which allows you to choose what happens to stdout from pfmon based on a pf.conf parameter. The benefit of doing this is that it means stdout errors get timestamped, and it's easier to work out exactly what was happening when they occurred. Basically, you create a new parameter called "stdout" in the "logging" section of pf.conf If this parameter is "syslog", then stdout will be redirected to the main pf logfile. If this parameter is "null", then stdout will be redirected to /dev/null If this parameter has any other value, or is undefined, then stdout will be redirected to /usr/local/pf/logs/pfmon as at present. Requires a modification to pfmon, and trivial additions to pf.conf.default and documentation.conf Bruce. | |||||||||
Steps To Reproduce | ||||||||||
Additional Information | pfmon: root@pf3:/usr/local/pf# diff bin/pfmon.OLD bin/pfmon 806,808d805 < #open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!"; < open STDOUT, '>>/usr/local/pf/logs/pfmon' or die "Can't write to /dev/null: $!"; 809a807,821 > if ($Config{'logging'}{'stdout'} =~ /^syslog$/i) { > my $logfacility = $Config{'logging'}{'facility'}; > my $logpriority = $Config{'logging'}{'priority'}; > pflogger("Redirecting stdout to syslog, $logfacility, $logpriority",20); > open STDOUT, "|/usr/bin/logger -p ${logfacility}.${logpriority} " or die "Can't write to syslog : $!"; > } > elsif ($Config{'logging'}{'stdout'} =~ /^null$/i) { > pflogger("Redirecting stdout to /dev/null",20); > open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!"; > } > else > { > pflogger("Redirecting stdout to logs/pfmon",20); > open STDOUT, '>>/usr/local/pf/logs/pfmon' or die "Can't write to /dev/null: $!"; > } root@pf3:/usr/local/pf# pf.conf.defaults: root@pf3:/usr/local/pf# diff conf/pf.conf.defaults.OLD conf/pf.conf.defaults 477a478,482 > # > # What to do with stdout from pfmon > # > stdout= > documentation.conf: root@pf3:/usr/local/pf# diff conf/documentation.conf.OLD conf/documentation.conf 648a649,655 > [logging.stdout] > type=text > description=<<EOT > What to do with stdout from pfmon. Options are "null" to send to /dev/null, > "syslog" to syslog via /usr/bin/logger to the main pf log file, and any other value to redirect to logs/pfmon > EOT > | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2006-10-18 15:17 | bruce | New Issue | ||||||||
2006-10-27 10:43 | kevmcs | Project | PacketFence 1.6.2 => PacketFence 1.6.5 | |||||||
2008-06-12 20:38 | user4 | Project | PacketFence 1.6.5 => PacketFence | |||||||
2008-09-10 16:34 | user4 | Relationship added | child of 0000381 | |||||||
2008-09-19 12:43 | user4 | Status | new => assigned | |||||||
2008-09-19 12:43 | user4 | Assigned To | => user4 | |||||||
2008-09-19 12:43 | user4 | Status | assigned => closed | |||||||
2008-09-19 12:43 | user4 | Note Added: 0000808 | ||||||||
2008-09-19 12:43 | user4 | Resolution | open => fixed |
Notes | |||||
|
|||||
|
|