I have two user processes A and B. Both use syslog using facility LOG_USER
.
I want to have different threshold levels for them:
- For A, only messages of priority ERR-and-above must be logged
- For B, only messages of priority CRIT-and-above must be logged
I found that if I setup /etc/syslog.conf
as:
user.err /var/log/messages
then messages of ERR-and-above are logged, but, from both A and B. How can I have different minimum threshold levels for different processes?
Note: I'm exploring if there is a config file based solution. Otherwise, there is another approach that works. In each process, we can use setlogmask()
to install process specific priority mask.
This is identical to: http://stackoverflow.com/questions/20010873/syslog-process-specific-priority