Page MenuHomePhabricator

Queue messages are logged twice
Open, LowPublic

Description

I really thought we had fixed this, at least attempted before. Not sure if there was a previous task, I couldn't find it.

The message is logged, then immediately again with class_name, message

Example message:
2025-01-23 01:10:06,215 ERROR civicrm.wmf.INFO: RecurringQueueConsumer array{"txn_type":"subscr_cancel","rescue_reference":"ZJ2HKCRVMB383Z59","is_
autorescue":true,"cancel_reason":"Payment cannot be rescued: maximum failures reached","source_name":"SmashPig","source_type":"listener","source_hos
t":"frpig1002","source_run_id":1224135,"source_version":"1d060a11706b20479061205a7b6f02a0e4f9b0ed","source_enqueued_time":1737594343} {"class_name":
"RecurringQueueConsumer","message":{"txn_type":"subscr_cancel","rescue_reference":"ZJ2HKCRVMB383Z59","is_autorescue":true,"cancel_reason":"Payment c
annot be rescued: maximum failures reached","source_name":"SmashPig","source_type":"listener","source_host":"frpig1002","source_run_id":1224135,"sou
rce_version":"1d060a11706b20479061205a7b6f02a0e4f9b0ed","source_enqueued_time":1737594343}}

Event Timeline

I have an explanation for this ...

We have 2 standard out loggers - in theory the wmf_cli one logs for wmf channel (only) for info and above and cli_std_out_l logs for all channels when the level is warning and above - so info is only logged by the former & only for wmf

idnametypechannelminimum_severityis_finalweight
5syslogsyslog*error0-2
7wmf_clistd_errwmfinfo01
8acoustic_infomailSilverpopinfo01
9alert_failmailmail*alert01
6cli_std_out_l...std_err*warning08
1wmf_syslogsyslogwmfdebug110
2default_loggerlog_file*debug015

However, IF we use --vv on the command line the log level for the latter one is adjusted per

'-v' => 'notice',
'--verbose' => 'notice',
'--debug' => 'debug',
'-d' => 'debug',
'-q' => 'error',
'--quiet' => 'error',
// https://symfony.com/doc/current/logging/monolog_console.html
'-vv' => 'info',
'-vvv' => 'debug',

In practice this means it always runs at info level & we get stuff twice

I am going to disable the wmf_cli on grounds of it being redundant - we could increase the weight & make the other final - but I'm struggling to make a case for that.