.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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" '' . ds C` . ds C' '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 >0, 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. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Catalyst::Log::Log4perl 3pm" .TH Catalyst::Log::Log4perl 3pm "2022-07-03" "perl v5.34.0" "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" Catalyst::Log::Log4perl \- DEPRECATED (see Log::Log4perl::Catalyst) .SH "SYNOPSIS" .IX Header "SYNOPSIS" In MyApp.pm: .PP .Vb 1 \& use Catalyst::Log::Log4perl; \& \& # then we create a custom logger object for catalyst to use. \& # If we don\*(Aqt supply any arguments to new, it will work almost \& # like the default catalyst\-logger. \& \& _\|_PACKAGE_\|_\->log(Catalyst::Log::Log4perl\->new()); \& \& # But the real power of Log4perl lies in the configuration, so \& # lets try that. example.conf is included in the distribution, \& # alongside the README and Changes. \& \& _\|_PACKAGE_\|_\->log(Catalyst::Log::Log4perl\->new(\*(Aqexample.conf\*(Aq)); .Ve .PP And later... .PP .Vb 1 \& $c\->log\->debug("This is using log4perl!"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a Catalyst::Log implementation that uses Log::Log4perl as the underlying log mechanism. It provides all the methods listed in Catalyst::Log, with the exception of: .PP .Vb 3 \& levels \& enable \& disable .Ve .PP These methods simply return 0 and do nothing, as similar functionality is already provided by Log::Log4perl. .PP These methods will all instantiate a logger with the component set to the package who called it. For example, if you were in the MyApp::C::Main package, the following: .PP .Vb 1 \& package MyApp::C::Main; \& \& sub default : Private { \& my ( $self, $c ) = @_; \& my $logger = $c\->log; \& $logger\->debug("Woot!"); \& } .Ve .PP Would send a message to the Myapp.C.Main Log::Log4perl component. .PP See Log::Log4perl for more information on how to configure different logging mechanisms based on the component. .SH "METHODS" .IX Header "METHODS" .IP "new($config, [%options])" 4 .IX Item "new($config, [%options])" This builds a new Catalyst::Log::Log4perl object. If you provide an argument to \fBnew()\fR, it will be passed directly to Log::Log4perl::init. .Sp The second (optional) parameter is a hash with extra options. Currently three additional parameters are defined: .Sp .Vb 2 \& \*(Aqautoflush\*(Aq \- Set it to a true value to disable abort(1) support. \& \*(Aqwatch_delay\*(Aq \- Set it to a true value to use L\*(Aqs init_and_watch \& \& \*(Aqoverride_cspecs\*(Aq \- EXPERIMENTAL \& Set it to a true value to locally override some parts of \& L. See L below .Ve .Sp Without any arguments, \fBnew()\fR will initialize a root logger with a single appender, Log::Log4perl::Appender::Screen, configured to have an identical layout to the default Catalyst::Log object. .IP "\fB_flush()\fR" 4 .IX Item "_flush()" Flushes the cache. Much like the way Catalyst::Log does it. .IP "abort($abort)" 4 .IX Item "abort($abort)" Causes the current log-object to not log anything, effectivly shutting up this request, making it disapear from the logs. .IP "debug($message)" 4 .IX Item "debug($message)" Passes it's arguments to \f(CW$logger\fR\->debug. .IP "info($message)" 4 .IX Item "info($message)" Passes it's arguments to \f(CW$logger\fR\->info. .IP "warn($message)" 4 .IX Item "warn($message)" Passes it's arguments to \f(CW$logger\fR\->warn. .IP "error($message)" 4 .IX Item "error($message)" Passes it's arguments to \f(CW$logger\fR\->error. .IP "fatal($message)" 4 .IX Item "fatal($message)" Passes it's arguments to \f(CW$logger\fR\->fatal. .IP "\fBis_debug()\fR" 4 .IX Item "is_debug()" Calls \f(CW$logger\fR\->is_debug. .IP "\fBis_info()\fR" 4 .IX Item "is_info()" Calls \f(CW$logger\fR\->is_info. .IP "\fBis_warn()\fR" 4 .IX Item "is_warn()" Calls \f(CW$logger\fR\->is_warn. .IP "\fBis_error()\fR" 4 .IX Item "is_error()" Calls \f(CW$logger\fR\->is_error. .IP "\fBis_fatal()\fR" 4 .IX Item "is_fatal()" Calls \f(CW$logger\fR\->is_fatal. .IP "\fBlevels()\fR" 4 .IX Item "levels()" This method does nothing but return \*(L"0\*(R". You should use Log::Log4perl's built in mechanisms for setting up log levels. .IP "\fBenable()\fR" 4 .IX Item "enable()" This method does nothing but return \*(L"0\*(R". You should use Log::Log4perl's built in mechanisms for enabling log levels. .IP "\fBdisable()\fR" 4 .IX Item "disable()" This method does nothing but return \*(L"0\*(R". You should use Log::Log4perl's built in mechanisms for disabling log levels. .SH "OVERRIDING CSPECS" .IX Header "OVERRIDING CSPECS" Due to some fundamental design incompatibilities of Log::Log4perl and Catalyst::Log all cspecs of Log::Log4perl::Layout::PatternLayout that rely on call stack information fail to work as expected. Affected are the format strings \f(CW%L\fR, \f(CW%F\fR, \f(CW%C\fR, \f(CW%M\fR, \f(CW%l\fR and \f(CW%T\fR. You can instruct \&\fBCatalyst::Log::Log4perl\fR to try to hijack these patterns which seems to work reasonable well, but be advised that this feature is \s-1HIGHLY EXPERIMENTAL\s0 and relies on a few internals of Log::Log4perl that might change in later versions of this library. Additionally, this feature is currently only tested with Log::Log4perl version 1.08 allthough the underlying internals of Log::Log4perl seem to be stable since at least version 0.47. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" The \f(CW%T\fR cspec of Log::Log4perl::Layout::PatternLayout is currently unimplemented. The implementation to get \f(CW%M\fR defies any logical approach but seems to work perfectly. .SH "SEE ALSO" .IX Header "SEE ALSO" Log::Log4perl, Catalyst::Log, Catalyst. .SH "AUTHORS" .IX Header "AUTHORS" Adam Jacob, \f(CW\*(C`adam@stalecoffee.org\*(C'\fR .PP Andreas Marienborg, \f(CW\*(C`omega@palle.net\*(C'\fR .PP Gavin Henry, \f(CW\*(C`ghenry@suretecsystems.com\*(C'\fR (Typos) .PP Sebastian Willert (Overriding \s-1CSPECS\s0) .PP J. Shirley \f(CW\*(C`jshirley@gmail.com\*(C'\fR (Adding _dump) .PP Tomas Doran (t0m) \f(CW\*(C`bobtfish@bobtfish.net\*(C'\fR (Current maintainer) .PP Wallace Reis (wreis) \f(CW\*(C`wreis@cpan.org\*(C'\fR .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2005 \- 2009 the Catalyst::Log::Log4perl \*(L"\s-1AUTHORS\*(R"\s0 as listed above. .SH "LICENSE" .IX Header "LICENSE" This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.