Log::Log4perl::Layout::PatternLayout Perl module contains a pattern layout.
SYNOPSIS
use Log::Log4perl::Layout::PatternLayout;
my $layout = Log::Log4perl::Layout::PatternLayout->new(
"%d (%F:%L)> %m");
Creates a pattern layout according to http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html and a couple of Log::Log4perl-specific extensions.
The new() method creates a new PatternLayout, specifying its log format. The format string can contain a number of placeholders which will be replaced by the logging engine when it's time to log the message:
%c Category of the logging event.
%C Fully qualified package (or class) name of the caller
%d Current date in yyyy/MM/dd hh:mm:ss format
%F File where the logging event occurred
%H Hostname (if Sys::Hostname is available)
%l Fully qualified name of the calling method followed by the
callers source the file name and line number between
parentheses.
%L Line number within the file where the log statement was issued
%m The message to be logged
%M Method or function where the logging request was issued
%n Newline (OS-independent)
%p Priority of the logging event
%P pid of the current process
%r Number of milliseconds elapsed from program start to logging
event
%T A stack trace of functions called
%x The topmost NDC (see below)
%X{key} The entry 'key' of the MDC (see below)
%% A literal percent (%) sign
NDC and MDC are explained in "Nested Diagnostic Context (NDC)" in Log::Log4perl and "Mapped Diagnostic Context (MDC)" in Log::Log4perl.
The granularity of time values is milliseconds if Time::HiRes is available. If not, only full seconds are used.
Product's homepage
Requirements:
· Perl