diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-04-10 04:51:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-10 04:51:08 +0200 |
commit | 694df9c1c6ec244c416c2d8e85657651b6a28dab (patch) | |
tree | 2985dfd5ed865d9b2192982196e846efc0c56656 /Bugzilla/Logging.pm | |
parent | 755bc194dcea3481fa41b5884a98a5aa086fe09e (diff) | |
download | bugzilla-694df9c1c6ec244c416c2d8e85657651b6a28dab.tar.gz bugzilla-694df9c1c6ec244c416c2d8e85657651b6a28dab.tar.xz |
Bug 1450679 - Replace custom Sentry integration with Logging
Diffstat (limited to 'Bugzilla/Logging.pm')
-rw-r--r-- | Bugzilla/Logging.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/Logging.pm b/Bugzilla/Logging.pm index 769485c86..4a7abcb21 100644 --- a/Bugzilla/Logging.pm +++ b/Bugzilla/Logging.pm @@ -10,7 +10,7 @@ use 5.10.1; use strict; use warnings; -use Log::Log4perl; +use Log::Log4perl qw(:easy); use Log::Log4perl::MDC; use File::Spec::Functions qw(rel2abs); use Bugzilla::Constants qw(bz_locations); @@ -20,11 +20,15 @@ sub is_interactive { return not exists $ENV{SERVER_SOFTWARE} } +sub fields { + return Log::Log4perl::MDC->get_context->{fields} //= {}; +} + BEGIN { my $file = $ENV{LOG4PERL_CONFIG_FILE} // 'log4perl-syslog.conf'; Log::Log4perl::Logger::create_custom_level('NOTICE', 'WARN', 5, 2); Log::Log4perl->init(rel2abs($file, bz_locations->{confdir})); - Log::Log4perl->get_logger(__PACKAGE__)->trace("logging enabled in $PROGRAM_NAME"); + TRACE("logging enabled in $PROGRAM_NAME"); } # this is copied from Log::Log4perl's :easy handling, |