0

I have isc-dhcp-relay/xenial-updates,now 4.3.3-5ubuntu12.10 amd64 [installed]

working good, how i can move logging this daemon from syslog to custom log file?

1

1 Answer 1

0

You can't. What you can do is make syslog log that to a separate file (see /etc/rsyslog.d/).

  • Create file /etc/rsyslog.d/dhcp-relay.conf
  • Add the line local7.* -/var/log/dhcp-relay.log
  • restart rsyslog

Also look at the file /etc/rsyslog.d/50-default.conf, maybe you want to change the line where it logs to /var/log/syslog to contain local7.none to avoid double loggings.

5
  • ... using what syntax? An example would go a long way towards making this a better answer.
    – Jeff Schaller
    Oct 20, 2020 at 15:47
  • i do not understand your answer if you have no knowledge why write something?
    – Roman
    Oct 20, 2020 at 16:12
  • You can't select a logfile, it is what it is. This is the answer. What you can do is make syslog write the dhcp-messages to a separate file though. I edited my answer.
    – stoney
    Oct 21, 2020 at 5:09
  • worked for dhcpd and not worked for dhcprelay. sorry, your misunderstuded the question. try to studying.
    – Roman
    Oct 22, 2020 at 9:31
  • My first sentence stands - you cannot change the daemon behavior without fiddling with the code to log to another syslog-faciliy (used to be local<somewaht>), now it is system daemon. You can write your own syslog-specs then. Start at the Syslog Documentation. It's not my answer bot your question.
    – stoney
    Oct 23, 2020 at 10:30

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.