Reduce/manage verbosity in the Queue operations

Created on 1 February 2024, 5 months ago
Updated 15 February 2024, 4 months ago

Problem/Motivation

Even when there is nothing to queue, each run of cron produces the following queueing output:

[notice] Syncing deletions for all Orange DAM keywords that have been deleted since 2024-01-19T08:05:56+00:00.
[notice] Retrieving 0 deleted keywords(s) from Orange Logic.
[notice] Filtering the results by the allowed tag types removed 0 keywords.
[notice] Queued deletions for 0 Orange DAM keywords.
[notice] Syncing deletions for all Orange DAM content that has been deleted since 2024-01-19T08:05:57+00:00.
[notice] No Orange DAM deleted objects found.
[notice] Queued deletions for 0 Orange DAM content items.
[notice] Queueing all Orange DAM keywords for re-syncing that have been updated since 2024-01-19T08:05:58+00:00.
[notice] No Orange DAM keywords updated since 2024-01-19T08:05:58+00:00.
[notice] Queued 0 Orange DAM keyword(s) for re-syncing.
[notice] Queueing all Orange DAM content for re-syncing with changes since 2024-01-19T08:05:59+00:00.
[notice] No Orange DAM items updated since 2024-01-19T08:05:59+00:00.
[notice] No Orange DAM content changes since 2024-01-19T08:05:59+00:00. Nothing to queue.

That's thirteen logs lines to basically say "nothing happened". This reduces the utility of the logs in watchdog.

Steps to reproduce

Run cron with orange_dam enabled.

Proposed resolution

I propose:
1. To keep the initial ("about to do something") statements, as they are quick verifications that these cron tasks are running.
2. If there are two statements that basically conclude the same thing, keep only one of them.
3. If the result was "nothing was done", demote the log level to debug and wrap the logging statement in

if ($this->configFactory->get('system.logging')->get('error_level') === 'verbose') {
// Log statement
}

which will allow the more fine grained diagnostic output to be turned on when necessary and, for users of dblog_filter module, be able to select whether to see notices or not.

Remaining tasks

Create a merge request with the above changes. The goal is to reduce these 13 lines to 4 lines when nothing is actually processed.

User interface changes

none

API changes

none

Data model changes

none

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apotek

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024