DHCP server logs

Issues related to configuring your network
Post Reply
jumper11
Posts: 4
Joined: 2022/11/02 07:49:31

DHCP server logs

Post by jumper11 » 2022/11/02 08:00:37

Hi,
I have a VB system installed and I am testing the DHCP server.
Where can I find the server log file?
Do I have to add the log location to the DHCP configuration file?
When I had problems with starting it said "journalctl -xe" should be checked, but shouldn't there be other logs?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: DHCP server logs

Post by TrevorH » 2022/11/02 11:05:37

On my EL7 systems when I used them to run dhcpd, it wrote logs to /var/log/messages
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jumper11
Posts: 4
Joined: 2022/11/02 07:49:31

Re: DHCP server logs

Post by jumper11 » 2022/11/03 07:26:14

I am using Rocky linux 8.6.
I don't have such a file / var / log / messages.
Has anything changed in this distribution?
I read in forums that logs now appear in "journalctl".
How to set saving dhcp logs to a separate file?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: DHCP server logs

Post by TrevorH » 2022/11/03 10:08:47

I don't have such a file / var / log / messages.
It's not / var / log / messages, it's /var/log/messages and as far as I know it's still the default log file. It's certainly present in my copy of Rocky 8.6. Maybe you don't have rsyslog installed and should?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

jumper11
Posts: 4
Joined: 2022/11/02 07:49:31

Re: DHCP server logs

Post by jumper11 » 2022/11/03 10:41:49

I just found out that rsyslog is needed and is not installed by default.
Does it require any additional configuration?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: DHCP server logs

Post by TrevorH » 2022/11/03 10:53:27

Not as far as I know. It can be configured but it should come out of the box working..
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: DHCP server logs

Post by jlehtone » 2022/11/03 12:27:11

jumper11 wrote:
2022/11/03 10:41:49
I just found out that rsyslog is needed and is not installed by default.
Does it require any additional configuration?
You did use the minimal iso to install? The package rsyslog is in yum group 'core', but it is in 'appstream' repo and the minimal iso has content only from 'baseos' repo. If you run dnf group install core, then some more packages do get installed.

The rsyslog.service runs fine with its defaults, so no additional config is required.


The systemd-journald.service is always there and collects at least as much data as the rsyslog does.
The journalctl is the tool to access journald-data. It has neat filter options.
For example: journalctl -xeu dhcpd.service
The output goes to pager (less), so jumping to latest messages (end) with '-e' is convenient.
The '-u dhcpd.service' limits to messages from that service.

The journald-data is by default only in RAM (in the /run/*) and thus lost on reboots.
That is probably sufficient for diagnosing startup issues, but if you want to keep older content,
then create directory /var/log/journal (as mentioned in man systemd-journal ).


Some programs, like Apache and Samba, do log directly to their own files, although systemd-journald and rsyslog do get some too.

jumper11
Posts: 4
Joined: 2022/11/02 07:49:31

Re: DHCP server logs

Post by jumper11 » 2022/11/03 12:54:11

Thanks for the information.
I'll check it :)

Post Reply