I am writing something and I wanted to take advantage of Linux API for logging, I wanted to put the logs of my app to different files, so I added those lines to rsyslog.conf
if $programname == 'RearWindowDaemon' then /var/log/RearWindowDaemon.log
if $programname == 'RearWindow' then /var/log/RearWindow.log
but something is not working, even with this simple code:
int main()
{
openlog("RearWindow",0,LOG_LOCAL0);
syslog(LOG_ERR,"some err");
syslog(LOG_ERR,"other err");
return;
}
I get the logs to /var/log/syslog
and not to /var/log/RearWindow
.
Should I do anything more? I am using XUbuntu 11.10 if it matters.