]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
docs - better documentation on logging
authorDylan William Hardison <dylan@hardison.net>
Thu, 13 Jun 2019 19:57:07 +0000 (15:57 -0400)
committerdklawren <dklawren@users.noreply.github.com>
Thu, 13 Jun 2019 19:57:07 +0000 (15:57 -0400)
README.rst
conf/log4perl-json.conf

index bd2a842d58af963e172fab1404acecd2db2be06c..e45e7bbe461ff1052151dc967f3c4fbaae10987f 100644 (file)
@@ -411,6 +411,7 @@ LOG4PERL_CONFIG_FILE
   If the file is given as a relative path, it will belative to the /app/conf/ directory.
 
 .. _`Devel::NYTProf`: https://metacpan.org/pod/Devel::NYTProf
+
 .. _`Log::Log4perl`: https://metacpan.org/pod/Log::Log4perl
 
 LOG4PERL_STDERR_DISABLE
@@ -420,6 +421,27 @@ LOG4PERL_STDERR_DISABLE
   Note: For programs that run using the `cereal` log aggregator, this environemnt
   variable will be ignored.
 
+
+Logging Configuration
+---------------------
+
+How Bugzilla logs is entirely configured by the environmental variable
+`LOG4PERL_CONFIG_FILE`.  This config file should be familiar to someone
+familiar with log4j, and it is extensively documented in `Log::Log4perl`_.
+
+Many examples are provided in the logs/ directory.
+
+If multiple processes will need to log, it should be configured to log to a socket on port 5880.
+This will be the "cereal" daemon, which will only be started for jobqueue and httpd-type containers.
+
+The example log config files will often be configured to log to stderr
+themselves.  To prevent duplicate lines (or corrupted log messages), stderr
+logging should be filtered on the existence of the LOG4PERL_STDERR_DISABLE
+environmental variable.
+
+Logging configuration also controls which errors are sent to Sentry.
+
+
 Persistent Data Volume
 ----------------------
 
index a9c4b6e1a387023cb7d05d18dc4384da3c2a1172..97a75e36ea681745de2ce1bf89727e4e66838b96 100644 (file)
@@ -12,13 +12,19 @@ log4perl.appender.Cereal.layout = Log::Log4perl::Layout::Mozilla
 log4perl.appender.Cereal.layout.max_json_length = 16384
 # The default is Bugzilla. This is the "Logger" field
 # in https://wiki.mozilla.org/Firefox/Services/Logging#MozLog_JSON_schema
-#and it might be useful to pass in different values for different jobs.
+# and it might be useful to pass in different values for different jobs.
 log4perl.appender.Cereal.layout.name = CEREAL
 
+# The cereal daemon ensures this env is set, so when it is set we do not need to log to stderr.
 log4perl.filter.LOG_TO_STDERR = sub { not $ENV{LOG4PERL_STDERR_DISABLE}  }
 log4perl.appender.Screen = Log::Log4perl::Appender::Screen
 log4perl.appender.Screen.Filter = LOG_TO_STDERR
+
+# change this to 0 to log to stdout
 log4perl.appender.Screen.stderr = 1
+
 log4perl.appender.Screen.layout = Log::Log4perl::Layout::Mozilla
 log4perl.appender.Screen.layout.max_json_length = 16384
+
+# This name could be something descriptive, like 'Bugzilla Fallback'
 log4perl.appender.Screen.layout.name = STDERR