<<

Log::Log4perl::Layout::Mozilla

NAME

Log::Log4perl::Layout::Mozilla - Implement the mozilla-services JSON log format

SYNOPSIS

Example configuration:

    log4perl.appender.Example.layout = Log::Log4perl::Layout::Mozilla
    log4perl.appender.Example.layout.max_json_length = 16384
    log4perl.appender.Example.layout.name = Bugzilla

DESCRIPTION

This class implements a Log::Log4perl layout format that implements the recommend JSON format using in Mozilla services. https://wiki.mozilla.org/Firefox/Services/Logging#MozLog_JSON_schema.

The JSON hash is ASCII encoded, with no newlines or other whitespace, and is suitable for output, via Log::Log4perl appenders, to files and syslog etc.

Contextual data in the Log::Log4perl::MDC hash will be put into the Fields hash.

LAYOUT CONFIGURATION

name

Data source, server that is doing the logging, e.g. "Sync-1_5".

Use the server's name, and avoid implementation details. "FxaAuthWebserver", not "NginxLogs".

max_json_length

Set the maximum JSON length in bytes. The default is 4096, and it cannot be smaller than 1024.

    log4perl.appender.Example.layout.max_json_length = 16384

This is useful where some downstream system has a limit on the maximum size of a message.

If the message is larger than this limit, the message will be replaced with a scary message at a severity level of ALERT.

<<