Can the changes to log_hooks:new be applied and reloaded without restarting Kumo?

Hi Team

I’m thinking — would it be possible to allow KumoMTA to adjust the parameters in log_hooks:new, specifically the log_parameters (including meta and per_record), without requiring a restart, perhaps with a relatively lightweight mechanism?

The scenario I’m considering is this: I’ve consistently encountered a situation where, after about a month of operation, I have to restart KumoMTA because some emails stop sending without any error messages. Details are here: link to Discord discussion.

I encountered this issue on September 19, October 20, November 18, and December 14.

After restarting, it returns to normal. There’s no fixed time pattern, so the only workaround is to add some alerting and then restart KumoMTA.

If it were possible to adjust the logging dynamically, I could view logs when the issue occurs without restarting.

The reason I can’t keep all logs enabled is that one of our major ISPs enforces a strict rate limit (20,000 messages per hour). If I enable Delayed logs, the log volume becomes excessively large.

As with many things, “it depends”.
If you are changing the Lua controlling the behaviour of the events, then that will refresh based on these rules:

or epoch (Configuration Lifecycle - KumoMTA Docs) depending on how you have things configured.
However, if you are changing the logging configuration, like here:

    -- Metadata added in smtp_server_message_received hook
    meta = { 'from', 'subject' },

    per_record = {
      -- SMTP and HTTP Incoming Monitoring, use for debugging only
      Reception = { enable = false },
      -- Rejected Incoming SMTP Command, use for debugging only
      Rejection = { enable = false },
      -- Internal Delayed messages, use for debugging only
      Delayed = { enable = false },
--      Delivery = { enable = false },
      Any = { enable = true },
    },
  },

Then that actually takes place in the INIT phase which will require a restart.

Yeah. I use logging configuration. I konw it will require a restart..

log_hooks:new {
  name = 'elk',
  batch_size = 100,
  log_parameters = {
    -- Metadata added in smtp_server_message_received hook
    meta = { 'from', 'subject' },

    per_record = {
      -- SMTP and HTTP Incoming Monitoring, use for debugging only
      Reception = { enable = false },
      -- Rejected Incoming SMTP Command, use for debugging only
      Rejection = { enable = false },
      -- Internal Delayed messages, use for debugging only
      Delayed = { enable = false },
--      Delivery = { enable = false },
      Any = { enable = true },
    },
  },
....other code