Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In a similar vein to Why is Syslog Not Writing Logs To The Designated Files?

I'm having a few problems with syslog on Ubuntu 10.0.4

I have an app which I have set to facility local7. I added the following line to /etc/rsyslog.d/50-default.conf

local7.*    /var/log/my.log

I then force rsyslogd to reload the config files as follows:

pgrep syslogd # returns 817  
sudo kill -HUP 817  

I run the following test:

$ logger local7.info hello

But the output appears in /var/log/syslog

Have I missed something? This works fine on my dev machine (Mac OS X)

share|improve this question
    
Additional information: According to lsof, syslog does not have my.log open. –  Richard Aug 6 '12 at 21:20

3 Answers 3

But the output appears in /var/log/syslog

Right, but does it also appear in /var/log/my.log. Syslog daemons will send a matching log line to every file that has a has a matching filter. In addition to adding the entry for the new file you also need to adjust the filter for /var/log/syslog so that it does not get local7.* messages.

share|improve this answer
    
It does not appear in my.log at all - that is my main problem –  Richard Aug 6 '12 at 21:19
    
BTW, it should be logger -p local7.info hello to send something to local7.info. –  Zoredache Aug 6 '12 at 22:22

Add "local7.none" to the line that logs to /var/log/syslog and reload syslogd (a one-line quick way is "sudo killall -HUP syslogd").

share|improve this answer
    
I will give that a try. THe output is not going to my.log though. –  Richard Aug 6 '12 at 21:19

Problem solved:

sudo service rsyslog restart

It appears that rsyslog does not respond to HUP like syslogd does.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.