[Rt-commit] rt branch, 5.0/add-configuration-warnings-to-preinit-logger-messages, created. rt-5.0.0-132-gc56da811e7
Blaine Motsinger
blaine at bestpractical.com
Sun Nov 29 20:00:29 EST 2020
The branch, 5.0/add-configuration-warnings-to-preinit-logger-messages has been created
at c56da811e7263d7a3d3ba13386b081ddcba31185 (commit)
- Log -----------------------------------------------------------------
commit c56da811e7263d7a3d3ba13386b081ddcba31185
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Sun Nov 29 18:43:00 2020 -0600
Add database config warnings to PreInitLoggerMessages
When RT logging for LogToSTDERR is set to warn, if a configuration
change in the database overrides one in siteconfig, a message is
output informing the admin of the override. This is expected
behavior, but can cause unnecessary repeated emails when output
during a cronjob. A frequent cronjob like fulltext indexer
running every couple minutes can create a lot of email.
This commit moves the database config override message to the
PreInitLoggerMessages array, which updates the output to happen at
debug instead of warn.
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 59ce078f1c..e43531eb0e 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -2669,7 +2669,9 @@ sub LoadConfigFromDatabase {
if ($meta->{'Source'}) {
my %source = %{ $meta->{'Source'} };
if ($source{'SiteConfig'} && $source{'File'} ne 'database') {
- warn("Change of config option '$name' at $source{File} line $source{Line} has been overridden by the config setting from the database. Please remove it from $source{File} or from the database to avoid confusion.");
+ push @PreInitLoggerMessages,
+ "Change of config option '$name' at $source{File} line $source{Line} has been overridden by the config setting from the database. "
+ ."Please remove it from $source{File} or from the database to avoid confusion.";
}
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list