Domanda

I have a C program that consists of a libev event loop. For one of the watchers there is an inner loop resulting in 100+ log messages (each ~200 characters long). For some reason only a third of the messages make it to the log file. The program does not exit. I can tell by the data that the watcher completes the inner loop successfully, it doesn't fail silently.

As an interesting twist, if I insert a printf statement just after each syslog call all log messages make it to the log file just fine.

How can this strange behavior be fixed? Of course I would expect all syslog calls to result in equivalent entries in the logfile.

I am not at liberty giving example code, but all calls are completely vanilla syslog calls. Elsewhere in the program they work fine.

If it matters, I am using Debian 7 (gcc 4.7.2-5) inside a VirtualBox VM in OSX 10.7.5 by way of ssh in the OSX terminal.

È stato utile?

Soluzione

So this turned out to be the message rate limiting of rsyslog kicking in. Changing the defaults as per here made the issue go away.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top