README
1NAME
2 Catalyst::Plugin::Log::Handler - Catalyst Plugin for Log::Handler
3
4VERSION
5 Version 0.08
6
7SYNOPSIS
8 use Catalyst qw(Log::Handler);
9
10 Catalyst configuration (e. g. in YAML format):
11
12 Log::Handler:
13 file:
14 filename: /var/log/myapp.log
15 fileopen: 1
16 mode: append
17 newline: 1
18
19 To log a message:
20
21 $c->log->debug('Greetings from the people of earth');
22 $c->log->info ('This is an info message.');
23 $c->log->warn ('This is the last warning.');
24 $c->log->error('This is an error message.');
25 $c->log->fatal('This is a fatal message.');
26 $c->handler->crit('This is a critical message.');
27
28DESCRIPTION
29 If your Catalyst project logs many messages, logging via standard error
30 to Apache's error log is not very clean: The log messages are mixed with
31 other web applications' noise; and especially if you use mod_fastcgi,
32 every line will be prepended with a long prefix.
33
34 An alternative is logging to a file. But then you have to make sure that
35 multiple processes won't corrupt the log file. The module Log::Handler
36 by Jonny Schulz does exactly this, because it supports message-wise
37 flocking.
38
39 This module is a wrapper for said Log::Handler.
40
41METHODS
42 debug, info, warn, error, fatal
43 These methods map to the Log::Handler methods with the same name, except
44 for fatal, which maps to emergency, and warn, which maps to warning.
45 This is because Catalyst and Log::Handler don't use the same names for
46 log levels.
47
48 To log a message with a level that is no common Catalyst log level, you
49 can use the handler method (see SYNOPSIS).
50
51 is_debug, is_info, is_warn, is_error, is_fatal
52 These methods map to the Log::Handler methods is_debug, is_info,
53 is_warning, is_error, is_emergency, respectively.
54
55 handler
56 Returns the Log::Handler object.
57
58CONFIGURATION
59 All configuration options are passed verbatim to Log::Handler::new. See
60 Log::Handler for explanation of the options. I think that the example
61 configuration at the beginning of this document is very well-suited for
62 a Catalyst application. (Except for the file name, of course.)
63
64 To be consistent with Catalyst::Log, the options minlevel and maxlevel
65 default to 0 and 7, respectively, i. e. all messages are logged. The
66 other defaults are not touched.
67
68 If you use Catalyst::Plugin::ConfigLoader, please load this module after
69 Catalyst::Plugin::ConfigLoader.
70
71AUTHOR
72 Christoph Bussenius <pepe(at)cpan.org>
73
74 If you use this module, I'll be glad if you drop me a note. You should
75 mention this module's name (or the short form CPLH) in the subject of
76 your mails, in order to make sure they won't get lost in all the spam.
77
78COPYRIGHT
79 Copyright (C) 2007,2010 Christoph Bussenius.
80
81 This program is free software; you can redistribute it and/or modify it
82 under the same terms as Perl itself.
83
84