With the introduction of the new log handling mechanism (linked list of log
handler, instead of a single instance of each type), some new issues have
arisen. I'd like to start a discussion on how to deal with them.
By default, a standard logfile has always been opened (/var/log/snmpd.log). In
old releases, many distributions disabled this via a command line option in the
init script (-l /dev/null). Of course, this now spits out a warning to use '-Lf
<file>' instead. Those who followed that advice were surprised to find out that
the default log file was still created, The new log handler allows multiple
log destinations, so setting one does not overwrite another.
The new -Ln (no log handling) was of little help, since it disabled logs before
the default file was opened. So, the only way to disable logging remains the
old way, '-l /dev/null'. If we want to eliminate this option one day, we need a
way of dealing with the default logfile.
Possible solutions:
1) set up default log before cmd line arg processing. '-Ln' will disable
default, and '-Lf file' can set another. This is a little inefficient, as the
default log handler will be disabled, bu still exist and thus be looked at
(and ignored) for every log message. It also introduces an ordering dependency,
as '-Lf file -Ln' would result in 2 log handlers, both disabled.
2) only set up the default location if no other logging option was set.
3) ?? you tell me...
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders