1Plack::Middleware::Log4Upseerrl(C3o)ntributed Perl DocumPelnatcakt:i:oMniddleware::Log4perl(3)
2
3
4
6 Plack::Middleware::Log4perl - Uses Log::Log4perl to configure logger
7
9 use Log::Log4perl;
10
11 Log::Log4perl::init('/path/to/log4perl.conf');
12
13 builder {
14 enable "Log4perl", category => "plack";
15 $app;
16 }
17
18 # in log4perl.conf
19 log4perl.logger.plack = INFO, Logfile
20 log4perl.appender.Logfile = Log::Log4perl::Appender::File
21 log4perl.appender.Logfile.filename = /path/to/logfile.log
22 log4perl.appender.Logfile.layout = Log::Log4perl::Layout::SimpleLayout
23
24 # Or let middleware to configure log4perl
25 enable "Log4perl", category => "plack", conf => '/path/to/log.conf';
26
28 Log4perl is a Plack::Middleware component that allows you to use
29 Log::Log4perl to configure logging object.
30
32 category
33 The log4perl category to send logs to. Defaults to '' which means
34 it send to the root logger.
35
36 conf
37 The configuration file path (or a scalar ref containing the config
38 string) for Log::Log4perl to automatically configure.
39
41 Tatsuhiko Miyagawa
42
44 Log::Dispatch
45
46
47
48perl v5.12.3 2011-02-27 Plack::Middleware::Log4perl(3)