Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question
    
I don't think you can do that with run-of-the-mill syslog. Are you ok with switching to rsyslog (available in most distributions including a FreeBSD port)? –  Gilles Nov 16 '13 at 22:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.