]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - make logging work right from morbo
authorDylan William Hardison <dylan@hardison.net>
Fri, 1 Feb 2019 22:46:56 +0000 (17:46 -0500)
committerDylan William Hardison <dylan@hardison.net>
Fri, 1 Feb 2019 22:46:56 +0000 (17:46 -0500)
conf/log4perl-morbo.conf [new file with mode: 0644]
scripts/start_morbo

diff --git a/conf/log4perl-morbo.conf b/conf/log4perl-morbo.conf
new file mode 100644 (file)
index 0000000..25ac816
--- /dev/null
@@ -0,0 +1,18 @@
+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.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.Screen = Log::Log4perl::Appender::Screen
+log4perl.appender.Screen.stderr = 1
+log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
+log4perl.appender.Screen.layout.ConversionPattern = %d %6p | %c | %m{chomp}%n
index 805b82c32463aa9afe55ef654fdf7041e33169ec..14461335376be7bfb88beb80edb1ef900fe868dd 100755 (executable)
@@ -14,7 +14,12 @@ BEGIN {
     catdir($BUGZILLA_DIR, qw(local lib perl5))
   );
 }
-use Env qw(@PATH @PERL5LIB $MOJO_LISTEN $BUGZILLA_ALLOW_INSECURE_HTTP MOJO_REVERSE_PROXY);
+use Env qw(
+  @PATH @PERL5LIB
+  $MOJO_LISTEN $MOJO_REVERSE_PROXY
+  $BUGZILLA_ALLOW_INSECURE_HTTP
+  $LOG4PERL_CONFIG_FILE
+);
 
 chdir $BUGZILLA_DIR;
 
@@ -26,9 +31,10 @@ if ($MOJO_LISTEN && -f $cert_file && -f $key_file) {
 }
 
 push @PERL5LIB, catdir($BUGZILLA_DIR, qw(local lib perl5));
-unshift @PATH,  catdir($BUGZILLA_DIR, qw(local bin));
+unshift @PATH, catdir($BUGZILLA_DIR, qw(local bin));
 $BUGZILLA_ALLOW_INSECURE_HTTP //= 1;
-$MOJO_REVERSE_PROXY //= $BUGZILLA_DIR ne '/vagrant';
+$MOJO_REVERSE_PROXY           //= $BUGZILLA_DIR ne '/vagrant';
+$LOG4PERL_CONFIG_FILE         //= 'log4perl-morbo.conf';
 
 my @files
   = ('Bugzilla.pm', 'Bugzilla', glob("*.cgi"), 'extensions', 'template');