Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to change Kea DHCP log level

    Scheduled Pinned Locked Moved DHCP and DNS
    kealoggingverbosityseverity
    3 Posts 2 Posters 354 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      LaUs3r
      last edited by

      Dear all,

      today I was struggling with the log level of the Kea DHCP server.
      I wanted to add a new client (smoke detector) to my environment with a static IP mapping. As I had no information about the MAC address, I was relying on the logs of the DHCP server to get the MAC first. From ISC I am used to pretty clear and easy to read log entries.
      With Kea I got no usable information as the log level is set to WARNINGS only.

      After doing some research, I couldn't find any straight info how to change the log level in pfSense, but in the end I managed to achieve it.

      There are 2 files you need to change on the pfSense box:

      1. keactrl.conf:
        file location: /usr/local/etc/kea/keactrl.conf
        Change the verbosity level, i.e. change "kea_verbose=no" --> "kea_verbose=yes".
        If you do not change this entry, all changes in the next file regarding the log level are not taken into account

      2. kea-dhcp4.conf
        file location: /usr/local/etc/kea/kea-dhcp4.conf
        Change in section "loggers" the entry for "severity". In my case, the level was set to "WARN". Based on the Kea documentation there are 5 different log levels: DEBUG, INFO, WARN, ERROR, FATAL (https://kea.readthedocs.io/en/kea-2.2.0/arm/logging.html).
        My final entry was: "severity": "INFO"

      3. Restart Kea

      keactrl reload
      

      The change to the kea-dhcp.conf is not persistent, i.e. does not survive a reboot

      Maybe this is helpful to the one or other.

      Cheers

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @LaUs3r
        last edited by

        @LaUs3r said in How to change Kea DHCP log level:

        keactrl.conf:

        Afaik, the process (program) keactrl isn't used by pfSense.
        The GUI starts "/usr/local/sbin/kea-dhcp4" (with config file /usr/local/etc/kea/kea-dhcp4.conf)
        and
        /usr/local/sbin/kea-dhcp6 with config file /usr/local/etc/kea/kea-dhcp6.conf

        • if you have IPv6 LAN(s) directly.

        Your 2) is .... well ... will work only ones.

        You've said it yourself :

        @LaUs3r said in How to change Kea DHCP log level:

        The change to the kea-dhcp.conf is not persistent, i.e. does not survive a reboot

        Consider this over simplified description of pfSense - the GUI.
        It's a nice looking super config file creator.
        So the very next time a process, like the DHCPv4 server kea-dhcp4, gets restarted, first, the config file is re created using GUI stored settings, and then the process is started.
        At that moment, your own edits of a file like /usr/local/etc/kea/kea-dhcp4.conf are gone.

        So, it won't survive a reboot, and it won't survive the very next process restart, for example when you save the DHCPv4 server settings page, for example.

        If you want to change the log "severity", have a look at /etc/inc/services.inc
        I presume you use 24.11 - pfSense Plus.

        Look here.
        Change you /etc/inc/services.inc, locate the same line, change WARN for INFO, save, restart DHCPv4 (kea) and voila.

        Btw :
        I've myself this :
        38ed983a-2c2c-464e-8aa6-f6977d4fb192-image.png

        so the "severity" setting gets its info from the kea/loglevel pfSense config file - but I never bothered to change also the GUI pages to select from an INFO, WARN ERROR etc list.

        These edit won't survive a pfSense version upgrade. But that's not an issue as the next update will include this option in the GUI for sure.

        @LaUs3r said in How to change Kea DHCP log level:

        I was relying on the logs of the DHCP server to get the MAC first

        Lol, I always do exactly that.
        And maybe the kea DHCPv4 logs are less detailed.
        But : you'll would find the lease (MAC) here :

        d09524f2-d8ac-44a6-9946-72b4239c4efb-image.png

        and this works out of the box ^^

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        L 1 Reply Last reply Reply Quote 1
        • L
          LaUs3r @Gertjan
          last edited by

          @Gertjan, thx very much for your awesome reply. I really appreciate it as I learned something new ๐Ÿ‘ ๐Ÿ˜Ž
          To be honest, it's the first time I read something about the services.inc-file. Super interesting!!

          Of course, I tried it and it works like a charm.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.