summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-10 17:29:02 +0200
committerGitHub <noreply@github.com>2018-04-10 17:29:02 +0200
commit0002ecc5bb7078e2da0350fcc3c2850cf02bcd7b (patch)
tree4a465207632b31ddae6d34df623ce37da5fd3267 /conf
parent58c4f6814461ee4e35f0cffbdd63d948df940d35 (diff)
downloadbugzilla-0002ecc5bb7078e2da0350fcc3c2850cf02bcd7b.tar.gz
bugzilla-0002ecc5bb7078e2da0350fcc3c2850cf02bcd7b.tar.xz
Bug 1450990 - Refactor a bunch of the logging config files
Diffstat (limited to 'conf')
-rw-r--r--conf/httpd.conf1
-rw-r--r--conf/log4perl-docker.conf14
-rw-r--r--conf/log4perl-json.conf12
-rw-r--r--conf/log4perl-test.conf9
-rw-r--r--conf/log4perl-vagrant.conf24
5 files changed, 51 insertions, 9 deletions
diff --git a/conf/httpd.conf b/conf/httpd.conf
index 7fe859b59..539ab4231 100644
--- a/conf/httpd.conf
+++ b/conf/httpd.conf
@@ -86,6 +86,7 @@ Include /app/conf/env.conf
PerlSwitches -wT
PerlRequire /app/mod_perl.pl
+PerlSetEnv LOG4PERL_STDERR_DISABLE 1
DirectoryIndex index.cgi
DocumentRoot "/app"
<IfDefine HTTPD_IN_SUBDIR>
diff --git a/conf/log4perl-docker.conf b/conf/log4perl-docker.conf
new file mode 100644
index 000000000..1f5a033fd
--- /dev/null
+++ b/conf/log4perl-docker.conf
@@ -0,0 +1,14 @@
+log4perl.rootLogger = DEBUG, Cereal, Screen
+log4perl.appender.Cereal = Log::Log4perl::Appender::Socket
+log4perl.appender.Cereal.PeerAddr=127.0.0.1
+log4perl.appender.Cereal.PeerPort=5880
+log4perl.appender.Cereal.defer_connection=1
+log4perl.appender.Cereal.layout = Log::Log4perl::Layout::PatternLayout
+log4perl.appender.Cereal.layout.ConversionPattern = %d %6p | %c | %m{chomp}%n
+
+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
+log4perl.appender.Screen.stderr = 1
+log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
+log4perl.appender.Screen.layout.ConversionPattern = %d %6p | %c | %m{chomp}%n
diff --git a/conf/log4perl-json.conf b/conf/log4perl-json.conf
index c5d7e2c1f..a9c4b6e1a 100644
--- a/conf/log4perl-json.conf
+++ b/conf/log4perl-json.conf
@@ -13,10 +13,12 @@ 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.
-log4perl.appender.Cereal.layout.name = Bugzilla
+log4perl.appender.Cereal.layout.name = CEREAL
-log4perl.filter.IS_INTERACTIVE = sub { Bugzilla::Logging::is_interactive() }
+log4perl.filter.LOG_TO_STDERR = sub { not $ENV{LOG4PERL_STDERR_DISABLE} }
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
-log4perl.appender.Screen.Filter = IS_INTERACTIVE
-log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
-log4perl.appender.Screen.layout.ConversionPattern = %-5.5p [%d] [%c] %m{chomp} at %F line %L (%M)%n
+log4perl.appender.Screen.Filter = LOG_TO_STDERR
+log4perl.appender.Screen.stderr = 1
+log4perl.appender.Screen.layout = Log::Log4perl::Layout::Mozilla
+log4perl.appender.Screen.layout.max_json_length = 16384
+log4perl.appender.Screen.layout.name = STDERR
diff --git a/conf/log4perl-test.conf b/conf/log4perl-test.conf
index 34b163073..77fc00af8 100644
--- a/conf/log4perl-test.conf
+++ b/conf/log4perl-test.conf
@@ -4,13 +4,14 @@ log4perl.appender.Cereal.PeerAddr=127.0.0.1
log4perl.appender.Cereal.PeerPort=5880
log4perl.appender.Cereal.defer_connection=1
log4perl.appender.Cereal.layout = Log::Log4perl::Layout::PatternLayout
-log4perl.appender.Cereal.layout.ConversionPattern = %-5.5p [%d] [%c] %m{chomp} at %F line %L (%M)%n
+log4perl.appender.Cereal.layout.ConversionPattern = %d %6p | %c | %m{chomp}%n
-log4perl.filter.IS_INTERACTIVE = sub { Bugzilla::Logging::is_interactive() }
+log4perl.filter.LOG_TO_STDERR = sub { not $ENV{LOG4PERL_STDERR_DISABLE} }
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
-log4perl.appender.Screen.Filter = IS_INTERACTIVE
+log4perl.appender.Screen.Filter = LOG_TO_STDERR
+log4perl.appender.Screen.stderr = 1
log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
-log4perl.appender.Screen.layout.ConversionPattern = %-5.5p [%d] [%c] %m{chomp} at %F line %L (%M)%n
+log4perl.appender.Screen.layout.ConversionPattern = %d %6p | %c | %m{chomp}%n
log4perl.appender.File = Log::Log4perl::Appender::File
log4perl.appender.File.layout = Log::Log4perl::Layout::Mozilla
diff --git a/conf/log4perl-vagrant.conf b/conf/log4perl-vagrant.conf
new file mode 100644
index 000000000..d9c3e2753
--- /dev/null
+++ b/conf/log4perl-vagrant.conf
@@ -0,0 +1,24 @@
+log4perl.rootLogger = DEBUG, TextFile, JSONFile, Screen
+
+log4perl.appender.TextFile = Log::Log4perl::Appender::File
+log4perl.appender.TextFile.layout = Log::Log4perl::Layout::PatternLayout
+log4perl.appender.TextFile.filename = sub { Bugzilla::Logging->logfile("bugzilla.log") }
+log4perl.appender.TextFile.layout.ConversionPattern = %-5.5p [%d] [%c] %m{chomp} at %F line %L (%M)%n
+log4perl.appender.TextFile.create_at_logtime = true
+log4perl.appender.TextFile.owner = vagrant
+log4perl.appender.TextFile.group = apache
+
+log4perl.appender.JSONFile = Log::Log4perl::Appender::File
+log4perl.appender.JSONFile.layout = Log::Log4perl::Layout::Mozilla
+log4perl.appender.JSONFile.filename = sub { Bugzilla::Logging->logfile("bugzilla-json.log") }
+log4perl.appender.JSONFile.mode = append
+log4perl.appender.JSONFile.create_at_logtime = true
+log4perl.appender.JSONFile.owner = vagrant
+log4perl.appender.JSONFile.group = apache
+
+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
+log4perl.appender.Screen.stderr = 1
+log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
+log4perl.appender.Screen.layout.ConversionPattern = %d %6p | %c | %m{chomp}%n