1
votes

I am running a Debian Jessie server and want to log some custom messages using syslog. I added the following line to rsyslog.conf local0.* -/var/log/mojosound.log

When I use the syslog function in my c program with this syntax:

syslog(LOG_LOCAL0, "Test Message");

I see the mojosound.log file created and updated each time I run the sample program. However, if I try and add a priority to the command, the message goes nowhere that I can find.

  int priority = LOG_MAKEPRI(LOG_LOCAL0, LOG_INFO);
  syslog(pritority, "Test Message");

There are no other references to local0 in the conf file and no other rules that look like they should matter.

I am thinking that it must be an issue with my conf file but I cannot find anything in the rsyslog documentation that would point to what it is.

Any ideas?

1
why don't you show your config file when you assume there is something wrong with it?mfro
may be logging level is not set properly? try using appropriate level using setlogmask (LOG_UPTO (LOG_NOTICE)); i generally set the local through openlog call.vk-code
Do /var/log/messages see it? And if you increase the priority?Giacomo Catenazzi
The conf file is long. How do I post it?mojosound
Vikram - I will try that and see. Thanks.mojosound

1 Answers

0
votes

rc.local was killing the rsyslog service at the end of startup. Took a while but finally found it.