Logging inadequate
Our syslog is full of
Jan 23 22:03:34 coworker[1015]: #033[31m[2024-01-23T22:03:34.987520+00:00] CiviQueueWatcher.ERROR: Failed to read queues!#033[0m
The actual logged exception includes the exception but because this does not reach syslog because without logging to a file it winds up adding the ColorFormatter with no context or extra
https://lab.civicrm.org/dev/coworker/-/blob/master/src/Command/ConfigurationTrait.php#L168
The easiest fix would be to just add to the format line - eg
$consoleFormatter = new ColoredLineFormatter(NULL, '[%datetime%] %channel%.%level_name%: %message%');
$consoleFormatter = new ColoredLineFormatter(NULL, '[%datetime%] %channel%.%level_name%: %message% %context% %extra%');
or bring it into line with the LineFormatter used in file mode - ie pass in NULL & we get
public const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
There are various ways we can make this configurable but I lean towards passing in NULL for the format & using the defaults. As we don't have obvious other users it seems hard to make a case for a lot of work on configurability & when there is an obvious advantage of just using the package default over the existing default that feels like the easy / sane fix.
Related: - we have a lot of noise in our syslog from these two
Jan 23 12:45:17 coworker[1448965]: #033[31m[2024-01-23T12:45:17.882285+00:00] Pipe[ctl#1].ERROR: Received unexpected response line: "{"jsonrpc":"2.0","result":[],"id":667944}"#033[0m
Jan 23 12:45:19 coworker[1448965]: #033[31m[2024-01-23T12:45:19.882223+00:00] Pipe[ctl#1].ERROR: Received unexpected response line: "civicrm.wmf.INFO: Early return as queue is backed up. 529 contributions in the last 5 minutes is greater than the threshold of 500"#033[0m
In the former case I think the issue is that it should be a notice not an error - this seems to be what happens when coworker respawns as part of it's normal operation
In the latter case the issue is not that it gets logged - but that it gets logged every second. We might be able to figure out how to do something to pause the queue in this case but it would also be every second when the queue processing is in maintenance mode I think. Perhaps that is fine since that is a more unusual event