Robert Story wrote:
1) it has distinct knowledge coded in for syslog logging and file/print
handling. Even to the point of logging differently formatted startup messages!
I'd like to remove the distinction, and have 1 format for all log types. The
only place this causes a problem is the startup message. Choices are:
a) snmp_log(LOG_INFO, "Starting snmptrapd %s\n", netsnmp_get_version());
b) snmp_log(LOG_INFO,
"%.4d-%.2d-%.2d %.2d:%.2d:%.2d NET-SNMP version %s Started.\n",
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec,
netsnmp_get_version());
What about aligning with snmpd which currently does
snmp_log(LOG_INFO, "NET-SNMP version %s\n", netsnmp_get_version());
but perhaps adding "snmptrapd" for distinction?
2) message formatting can be specified the documented following ways:
command line
-F, for logging to stdout
snmptrapd.conf
format1, for v1 traps
format2, for v2 traps/informs
Additionally, there are the following *undocumented* ways:
snmptrapd.conf
print1, for v1 traps
print2, for v2 traps/informs
syslog1, for v1 traps
syslog2, for v2 traps/informs
Currently snmptrapd will register a syslog handler OR a print handler after
processing arguments. Both handlers call snmp_log() to log the final formatted
result, so the if even if multiple logs and different formats are configured,
only one format will be used for all logs.
It seems to me, in this day and age of multiple log handlers, this mode of
configuration is outdated, and supporting different formats for different
logging methods is overly complex, doesn't work now, and I'd be willing to bet
it never did!
I tend to agree, but what's your actual proposal here?
Do we want to add an option to allow appending to log files? The option used
by snmpd, -A, does not appear to be used by snmptrapd.
This'd be helpful, especially since 5.2.x and 5.3 have different default
behaviour which cannot be changed now (IIUC).
+Thomas
--
Thomas Anders (thomas.anders at blue-cable.de)
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders