Can't call method "_should_log" on an undefined value

Since upgrading perl to 5.40 I’ve been getting errors from my cron jobs.
I just upgraded RT to 5.0.8 (running on FreeBSD 14.2, RT installed from ports) but I’m still getting one error when I run rt-fulltext-indexer:

(in cleanup) Can't call method "_should_log" on an undefined value at /usr/local/lib/perl5/site_perl/Log/Dispatch.pm line 274, <DATA> line 960 during global destruction.

I’ve grepped through everything in rt code, and I can’t see it calling _should_log.
I found this in Log Dispatch changelog:

This version introduces some changes into the interface that will
cause incompatibility with any Log::Dispatch::Output interface you may
have created. However, it is fairly simple to fix. Simply change the
method in your subclass named ‘log’ to be called ‘log_message’. You
can also remove the line:

return unless $self->_should_log($params{level});

This is now done before the message ever gets to the Output subclass
(which is what it should have done in the first place, really.)

This was done so that I could allow per-Output object callbacks, a
feature which several people have requested and which seems useful
enough to warrant the breakage.

NOTE: This change is transparent if you are only using the Output
objects included with this distribution.

Any idea where to look?

Are you running Oracle as your database?

No, we’re running PostgreSQL