1

I have installed isc-dhcp on Jessie. It works. However, I noticed it logs to three log files in /var/log/:

  1. syslog
  2. messages
  3. dhcp.log

I'd like to keep dhcpd to log to dhcp.log and stop it from logging to syslog and messages.

I have this line in dhcpd.conf:

log-facility local7;

I have added the following to /etc/rsyslog.conf:

local7.*        /var/log/dhcp.log

And also added the second line below.

\*.=info;\*.=notice;*.=warn;\  
    /dhcpd,local7.none;/\  
    auth,authpriv.none;\  
    cron,daemon.none;\  
    mail,news.none          -/var/log/messages

I restarted dhcp and syslog, still the same; dhcp logs to all three log files.

What am I doing wrong?

-1

You can do this without editing your config files by using symbolic links.

First delete the log file you don't want to keep :

rm /var/log/syslog  
rm /var/log/messages  

Next create a symbolic link that lead to /dev/null :

ln -s /dev/null /var/log/syslog
ln -s /dev/null /var/log/messages

Now DHCP will still write informations on these "files", but the content will be live deleted :)

Edit : If anyone knows how to do this in the config file, it would be nice !

  • 3
    Well, I want to kepp syslog and messages; but do not want dhcp to log to it. – MaxG Jun 16 '17 at 21:14
  • 4
    Disabling system logs is a terrible advice, -1. – madneon Jan 17 '18 at 20:04
  • 1
    I agree with this ! Any better answer is welcomed :) – Technico.top Jan 22 '18 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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