Problem/Motivation
On sites with active content migrations or frequent cron-based content updates, Silktide will produce a log entry for each content update or creation. This produces large amounts of log messages with very little added value. Depending on the site's logging configuration, a migration could cause Silktide to fill up the watchdog log up to the configured limit, after which the cron maintenance task will clean everything up — including potentially useful log messages from other modules.
Steps to reproduce
- Enable the Silktide module on a Drupal site.
- Run a content migration or trigger a bulk content update (e.g., via Drush or a migration plugin) that creates or updates a large number of nodes.
- Check the watchdog log (Reports > Recent log messages).
- Observe that Silktide has produced one
info-level log entry per notified URL, flooding the log table.
Proposed resolution
Add a Verbose logging checkbox to the Silktide settings form that gates the log entry for successful Silktide notifications. When the option is disabled (the new default), only failures are logged. When enabled, successful notifications are logged as before.
The change is implemented across four files:
- config/schema/silktide.schema.yml — adds the
verbose_loggingboolean key to thesilktide.settingsconfig schema. - silktide.install — adds update hook
silktide_update_11201()that setsverbose_loggingtoFALSEfor existing installations if the key is not yet present. - src/Form/SilktideForm.php — adds the Verbose logging checkbox to the admin settings form with the description: "When enabled, successful Silktide notifications are also logged. By default only failures are logged."
- src/SilktideService.php — wraps the existing
info-level log call in averbose_loggingguard so it is only executed when the option is turned on.
Remaining tasks
- Review and merge.
User interface changes
A new Verbose logging checkbox is added to the Silktide administration settings form (Administration > Configuration > Web services > Silktide). It is unchecked by default.
API changes
A new boolean configuration key verbose_logging is added to the silktide.settings configuration object. It defaults to FALSE. No existing public APIs are changed.
Data model changes
No database schema changes. The new verbose_logging value is stored in Drupal's standard configuration system. Existing sites receive the new key with a value of FALSE via the silktide_update_11201() update hook.
Issue fork silktide-3578476
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
arturs.v commented