Open he32 opened 2 years ago
Oh, yes, I should have said: this testing & observations is done with ExaBGP version 4.2.21.
And ... in the current exabgp code off github (substantially different from 4.2.21, at least in the logging department), I find in src/exabgp/logger/handler.py
:
def _syslog(**kwargs):
formating = kwargs.get('format', SHORT)
handler = handlers.SysLogHandler(
address=kwargs.get('address', '/dev/log'),
facility=kwargs.get('facility', 'syslog'),
)
Does that mean that the default facility is now syslog
? That doesn't match well with the comment in <sys/syslog.h>
:
#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
I am happy to change the way syslog works to be clearer and follow the expectation of users.
I believe the team uses stdout myself and it has been years since I have been a UNIX admin so I am a bit rusty.
If you have suggestions, I am happy to implement them.
With reference to issue #1121, this specific issue concentrates on the logging done by exabgp, perhaps first and foremost when it is run as a daemon.
It does appear that the following holds true:
facility=user
andpriority=debug
. I would have expected the log level for different log messages to vary across the exabgp code base, based at least partly on their "chattiness", and at least that some of them had a level of "notice" or at least "info".facility=user
is wrong.facility=user
. This is one of the important points of reference documentation: clearly document the external interface to your program. Yes, this includes "where do you send your syslog messages and how are they tagged".facility=user
log messages. Ref. the previous point.healtcheck
exabgp module's syslog messages are visible in/var/log/messages
with a default NetBSD syslog.conf file, and it logs the "send announces for UP state to ExaBGP" messages withfacility=daemon
andpriority=info
. This contributed to my confusion as to where the log messages from exabgp itself ended up, as I would have expected "the same place".How did I find this out? Looking at the system call trace, of course:
etc. while the healthcheck module which runs as a separate process logs
15 = 8+7, and 8 is 1x8 and 1 is "user", and 7 is "debug". 30 = 24+6, and 24 is 3x8 and 3 is "daemon", and 6 is "info".