- 🇺🇸United States mfb San Francisco
This has some overlap with ✨ Provide a way to disable creation of database log entries Needs work
Many Drupal agencies host client websites at different hosting providers, each of them doing logging in different ways. Some hosting providers (Acquia, Platform.sh) suggest using Syslog which is more performant, but others (Pantheon) don't support or expose system logs to site owners who are stuck with Dblog in prod. Regardless of prod hosting, we'd love to have developer local environment tooling be standardized as much as possible, easy to use and debug, with minimal additional configurations/setup required. This means local environment should be logging to watchdog logs for ease-of-use (dblog module). Optionally, syslog could be disabled as well on local, but I see no huge harm in leaving it enabled.
Therefore, I'd like a way to have both syslog and dblog modules enabled (in core.extension.yml) and configured (in [dblog|syslog].settings.yml), but then "muted" in specific environments via kill-switch logic in settings.php or settings.local.php, so that I can have syslog running in PROD, but dblog on in LOCAL and DEV all without incurring configuration yml changes.
This will improve developer experience who would want to quickly and easily see the errors in dblog without having to setup syslog handling on local/dev environments. (for example, DDEV doesn't support syslog out of the box).
Also having a kill-switch means less devops procedures such as a post-db-sync task to enable dblog / disable syslog, and also therefore fewer mishaps when developers export and commit configuration changes accidentally committing unrelated actions like enabling dblog in core.extensions.yml which could then get sent up to production, if not careful.
Dblog has a row_limit setting which might seem like an obvious kill-switch, until you realize the purpose of row_limit=0 is to disable cron from purging rows in the table.
I would suggest two sister kill-switches, one for syslog and one for dblog:
$disable_dblog = \Drupal::config('dblog.settings')->get('disable_logging');
$disable_syslog = \Drupal::config('syslog.settings')->get('disable_logging');
The configuration would typically be set to disable_logging: false by default, for backward compatibility with sites that may not yet have the value set or undefined/null.
A boolean checkbox could be exposed in their respective module settings forms but for the primary use case this is not required.
Then, developers could turn it off in settings.php conditional logic or in settings.local.php
// if PROD
$config['dblog.settings']['disable_logging'] = TRUE;
$config['syslog.settings']['disable_logging'] = FALSE;
// else if DEV/TEST/LOCAL
$config['dblog.settings']['disable_logging'] = FALSE;
$config['dblog.settings']['disable_logging'] = TRUE;
None.
Two additional module settings named "disable_logging" for core syslog and dblog modules.
None
TBD
Active
10.0 ✨
Enhances developer experience.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This has some overlap with ✨ Provide a way to disable creation of database log entries Needs work