.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Jifty::Logger 3pm" .TH Jifty::Logger 3pm "2011-02-09" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Jifty::Logger \-\- A master class for Jifty's logging framework .SH "DESCRIPTION" .IX Header "DESCRIPTION" Jifty uses the Log4perl module to log error messages. In Jifty programs there's two ways you can get something logged: .PP Firstly, Jifty::Logger captures all standard warnings that Perl emits. So in addition to everything output from perl via the warnings pragmas, you can also log messages like so: .PP .Vb 1 \& warn("The WHAM is overheating!"); .Ve .PP This doesn't give you much control however. The second way allows you to specify the level that you want logging to occur at: .PP .Vb 5 \& Jifty\->log\->debug("Checking the WHAM"); \& Jifty\->log\->info("Potential WHAM problem detected"); \& Jifty\->log\->warn("The WHAM is overheating"); \& Jifty\->log\->error("PANIC!"); \& Jifty\->log\->fatal("Someone call Eddie Murphy!"); .Ve .SS "Configuring Log4perl" .IX Subsection "Configuring Log4perl" Unless you specify otherwise in the configuration file, Jifty will supply a default Log4perl configuration. .PP The default log configuration that logs all messages to the screen (i.e. to \s-1STDERR\s0, be that directly to the terminal or to the FastCGI log file.) It will log all messages of equal or higher priority to the LogLevel configuration option. .PP .Vb 3 \& \-\-\- \& framework: \& LogLevel: DEBUG .Ve .PP You can override the LogLevel configuration option by setting \s-1JIFTY_LOG_LEVEL\s0 in your environment. .PP You can tell Jifty to use an entirely different Logging configuration by specifying the filename of a standard Log4perl config file in the LogConfig config option (see Log::Log4perl for the format of this config file.) .PP .Vb 3 \& \-\-\- \& framework: \& LogConfig: etc/log4perl.conf .Ve .PP Note that specifying your own config file prevents the LogLevel config option from having any effect. .PP You can tell Log4perl to check that file periodically for changes. This costs you a little in application performance, but allows you to change the logging level of a running application. You need to set LogReload to the frequency, in seconds, that the file should be checked. .PP .Vb 4 \& \-\-\- \& framework: \& LogConfig: etc/log4perl.conf \& LogReload: 10 .Ve .PP (This is implemented with Log4perl's init_and_watch functionality) .SH "METHODS" .IX Header "METHODS" .SS "new \s-1COMPONENT\s0" .IX Subsection "new COMPONENT" This class method instantiates a new \f(CW\*(C`Jifty::Logger\*(C'\fR object. This object deals with logging for the system. .PP Takes an optional name for this Jifty's logging \*(L"component\*(R" \- See Log::Log4perl for some detail about what that is. It sets up a \*(L"warn\*(R" handler which logs warnings to the specified component. .SS "_warning_action" .IX Subsection "_warning_action" change the Log4Perl action from warn to error|info|etc based on the content of the warning. .PP Added because DBD::Pg throws up \s-1NOTICE\s0 and other messages as warns, and we really want those to be info (or error, depending on the code). List based on Postgres documentation .PP \&\s-1TODO:\s0 needs to be smarter than just string matching .PP returns a valid Log::Log4Perl action, if nothing matches will return the default of warn since we're in a _\|_WARN_\|_ handler .SH "AUTHOR" .IX Header "AUTHOR" Various folks at Best Practical Solutions, \s-1LLC\s0. .PP Mark Fowler fiddled a bit.