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 /Log | |
parent | 755bc194dcea3481fa41b5884a98a5aa086fe09e (diff) | |
download | bugzilla-694df9c1c6ec244c416c2d8e85657651b6a28dab.tar.gz bugzilla-694df9c1c6ec244c416c2d8e85657651b6a28dab.tar.xz |
Bug 1450679 - Replace custom Sentry integration with Logging
Diffstat (limited to 'Log')
-rw-r--r-- | Log/Log4perl/Layout/Mozilla.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Log/Log4perl/Layout/Mozilla.pm b/Log/Log4perl/Layout/Mozilla.pm index 67a070c54..b625c54f4 100644 --- a/Log/Log4perl/Layout/Mozilla.pm +++ b/Log/Log4perl/Layout/Mozilla.pm @@ -52,6 +52,7 @@ sub render { ); my $mdc = Log::Log4perl::MDC->get_context; + my $fields = $mdc->{fields} // {}; my %out = ( EnvVersion => LOGGING_FORMAT_VERSION, Hostname => $HOSTNAME, @@ -60,12 +61,12 @@ sub render { Severity => $Log::Log4perl::Level::SYSLOG{$priority}, Timestamp => time() * 1e9, Type => $category, - Fields => { msg => $msg, %$mdc }, + Fields => { msg => $msg, %$fields }, ); my $json_text = $JSON->encode(\%out) . "\n"; if (length($json_text) > $self->max_json_length) { - my $scary_msg = sprintf( "DANGER! LOG MESSAGE TOO BIG %d > %d", length($json_text), $self->max_json_length ); + my $scary_msg = sprintf 'DANGER! LOG MESSAGE TOO BIG %d > %d', length($json_text), $self->max_json_length; $out{Fields} = { remote_ip => $mdc->{remote_ip}, msg => $scary_msg }; $out{Severity} = 1; # alert $json_text = $JSON->encode(\%out) . "\n"; |