PacketFence
Bug Tracking System

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000136PacketFencepublic2006-10-18 15:172008-09-19 12:43
Reporterbruce 
Assigned Touser4 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000136: Logging enhancement to send stdout to syslog etc
DescriptionHere 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.
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
>
TagsNo tags attached.
fixed in git revision
fixed in mtn revision
Attached Files

- Relationships
child of 0000381closeduser4 Log management 

-  Notes
(0000808)
user4
2008-09-19 12:43

mtn revision 6283f586250069e6eb4dd5bec045ce8f8f4683d1

- 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


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker