[Kea-users] Kea dhcp log rotate

Marek Hajduczenia mxhajduczenia at gmail.com
Fri Jun 21 14:31:08 UTC 2024


Not sure whether it is not 2.4.1 specific problem. In kea 2.6.0 and the
following logger config, everything works fine. I am running on Ubuntu
22.04.03 LTS

 

    "loggers": [

    {

          "name": "kea-dhcp4",

          "severity": "INFO",

          "output_options": [{

              "output": "/var/log/kea/dhcp4-all.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n",

              "flush": true,

              "maxver": 10,

              "maxsize": 102400000 

          }]

    },

    {

          "name": "kea-dhcp4.dhcpsrv",

          "severity": "INFO",

          "output_options": [{

              "output": "/var/log/kea/dhcp4-dhcpsrv.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n",             

              "flush": true,

              "maxver": 10,

              "maxsize": 102400000 

          }]

    },

    {

          "name": "kea-dhcp4.eval",

          "severity": "DEBUG",

          "debuglevel": 99,

          "output_options": [{

              "output": "/var/log/kea/dhcp4-eval.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n",             

              "flush": true,

              "maxver": 10,

              "maxsize": 102400000 

          }]

    },      

    {

          "name": "kea-dhcp4.leases",

          "severity": "INFO",

          "output_options": [{

              "output": "/var/log/kea/dhcp4-leases.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n",             

              "flush": true,

              "maxver": 10,

              "maxsize": 102400000 

          }]

    },

    {

          "name": "kea-dhcp4.bad-packets",

          "severity": "DEBUG",

          "debuglevel": 99,

          "output_options": [{

              "output": "/var/log/kea/dhcp4-pad-packets.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n",             

              "flush": true,

              "maxver": 10,

              "maxsize": 102400000 

          }]

    },    

    {

          "name": "kea-dhcp4.packets",

          "severity": "DEBUG",

          "debuglevel": 99,

          "output_options": [{

              "output": "/var/log/kea/dhcp4-packets.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n",

              "flush": true,

              "maxver": 10,

              "maxsize": 102400000 

          }]

    }],

 

Files are rotated without any problems 

 

root at server-kea-node1:/var/log/kea# ls -lah

total 206M

drwxr-x---  2 _kea _kea   4.0K Jun 21 14:04 .

drwxrwxr-x 10 root syslog 4.0K Jun 21 00:02 ..

-rw-r--r--  1 _kea _kea   702K Jun 21 14:28 dhcp4-all.log

-rw-r--r--  1 _kea _kea      0 Jun 21 13:34 dhcp4-all.log.lock

-rw-r--r--  1 _kea _kea    54K Jun 21 14:27 dhcp4-dhcpsrv.log

-rw-r--r--  1 _kea _kea      0 Jun 21 13:34 dhcp4-dhcpsrv.log.lock

-rw-r--r--  1 _kea _kea    73M Jun 21 14:28 dhcp4-eval.log

-rw-r--r--  1 _kea _kea    98M Jun 21 14:04 dhcp4-eval.log.1

-rw-r--r--  1 _kea _kea      0 Jun 21 13:34 dhcp4-eval.log.lock

-rw-r--r--  1 _kea _kea    15K Jun 21 14:27 dhcp4-leases.log

-rw-r--r--  1 _kea _kea      0 Jun 21 13:34 dhcp4-leases.log.lock

-rw-r--r--  1 _kea _kea   7.7M Jun 21 14:28 dhcp4-packets.log

-rw-r--r--  1 _kea _kea      0 Jun 21 13:34 dhcp4-packets.log.lock

-rw-r--r--  1 _kea _kea   888K Jun 21 14:28 dhcp4-pad-packets.log

-rw-r--r--  1 _kea _kea      0 Jun 21 13:34 dhcp4-pad-packets.log.lock

 

Marek

 

From: Kea-users <kea-users-bounces at lists.isc.org> On Behalf Of Kristof Van
Doorsselaere via Kea-users
Sent: Friday, June 21, 2024 4:02 AM
To: kea-users at lists.isc.org
Cc: Kristof Van Doorsselaere <kristof.vandoorsselaere at hogent.be>
Subject: [Kea-users] Kea dhcp log rotate

 

Dear All,

 

We are running kea 2.4.1 in our production network (University college).

 

In the kea dhcpv4 config I have setup below loggers:

 

"loggers": [

      {

        "debuglevel": 0,

        "name": "kea-dhcp4",

        "output_options": [

          {

            "flush": false,

            "maxsize": 10240000,

            "maxver": 8,

            "output": "/var/log/kea-dhcp4.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n"

          }

        ],

        "severity": "INFO"

      },

      {

        "debuglevel": 0,

        "name": "kea-dhcp4.bad-packets",

        "output_options": [

          {

            "flush": true,

            "maxsize": 10240000,

            "maxver": 8,

            "output": "/var/log/kea-dhcp4-debug.log",

            "pattern": "%d{%j %H:%M:%S.%q} %c %m\n"

          }

        ],

        "severity": "ERROR"

      }

    ],

 

Kea is running on a redhat 8.9

 

For some reason the old logs are not preserved when they get rotated, only 1
log file is available at any time (latest)

 

Anyone experience a similar problem?

 

Thanks in advance,

Kristof

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20240621/4b715414/attachment-0001.htm>


More information about the Kea-users mailing list