I am trying to get a couple of programs to log to the syslog on a MicroCore x64 machine, one written in python and one in Java, but neither one does. However, if I create a C program that does the same it works just fine. Does anyone have any idea what is going on? Are both the Python logging module and Log4J misconfigured or am I doing something stupid?
It does not matter whether I start syslogd from the boot script or manually with "sudo syslogd -n". Looking at the syslog, there are entries from the kernel, sshd and sudo.
The python script (which works just fine on my Mac BTW) looks like this:
#!/usr/bin/env python
import logging
from logging.handlers import SysLogHandler
log = logging.getLogger(__name__)
logging.getLogger().addHandler(SysLogHandler())
log.error("I'm logging this")
.. and the C program that works looks like this:
#include <syslog.h>
void main() {
syslog(LOG_ERR, "I'm logging this");
}