From 4a29d896ea90e8174ca10a8fd696e4c0767d3350 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 21 Jun 2018 17:17:21 -0400 Subject: add request id to logs --- Log/Log4perl/Layout/Mozilla.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Log/Log4perl/Layout') diff --git a/Log/Log4perl/Layout/Mozilla.pm b/Log/Log4perl/Layout/Mozilla.pm index b625c54f4..4aedd9843 100644 --- a/Log/Log4perl/Layout/Mozilla.pm +++ b/Log/Log4perl/Layout/Mozilla.pm @@ -53,6 +53,9 @@ sub render { my $mdc = Log::Log4perl::MDC->get_context; my $fields = $mdc->{fields} // {}; + if ($mdc->{request_id}) { + $fields->{request_id} = $mdc->{request_id} + } my %out = ( EnvVersion => LOGGING_FORMAT_VERSION, Hostname => $HOSTNAME, -- cgit v1.2.3-24-g4f1b