Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simultaneously write to multiple syslog facilities?

Is it possible to have one application simultaneously write to multiple syslog facilities?

I have an application, written in C/C++, that I would like to write some messages to local0 and other messages to local1. I do not want the messages for local0 to appear in local1 or vice versa.

like image 684
jschmier Avatar asked Dec 14 '22 00:12

jschmier


1 Answers

Looking at the man page for syslog, I see the example:

syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");

Does

syslog(LOG_INFO|LOG_LOCAL0, "message for local0");
syslog(LOG_INFO|LOG_LOCAL1, "message for local1");

work?

like image 116
Aidan Cully Avatar answered Dec 15 '22 15:12

Aidan Cully