4

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)

Richard
  • 41
  • 1

3 Answers3

2

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.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
0

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").

Todd Lyons
  • 2,006
  • 16
  • 12
0

Problem solved:

sudo service rsyslog restart

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

Richard
  • 41
  • 1