If called without parameters, new() initializes Log4perl in a way
so that messages are logged similarly to Catalysts default logging
mechanism. If you provide a configuration, either the name of a configuration
file or a reference to a scalar string containing the configuration, it
will call Log4perl with these parameters.
The second (optional) parameter is a list of key/value pairs:
|_flush()||Flushes the cache.|
|abort($abort)||Clears the logging systems internal buffers without logging anything.|
If youre tired of typing
and would prefer to use Log4perls convenient :easy mode macros like
then just pull those macros in via Log::Log4perls :easy mode and start cranking:
Note the difference between Log4perls initialization in Catalyst, which uses the Catalyst-specific Log::Log4perl::Catalyst module (top of this page), and making use of Log4perls loggers with the standard Log::Log4perl loggers and macros. While initialization requires Log4perl to perform dark magic to conform to Catalysts different logging strategy, obtaining Log4perls logger objects or calling its macros are unchanged.
Instead of using Catalysts way of referencing the context object $c to obtain logger references via its log() method, you can just as well use Log4perls get_logger() or macros to access Log4perls logger singletons. The result is the same.
Copyright 2002-2013 by Mike Schilli <firstname.lastname@example.org> and Kevin Goess <email@example.com>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Please contribute patches to the project on Github:
Send bug reports or requests for enhancements to the authors via our
MAILING LIST (questions, bug reports, suggestions/patches): firstname.lastname@example.org
Contributors (in alphabetical order): Ateeq Altaf, Cory Bennett, Jens Berthold, Jeremy Bopp, Hutton Davidson, Chris R. Donnelly, Matisse Enzer, Hugh Esco, Anthony Foiani, James FitzGibbon, Carl Franks, Dennis Gregorovic, Andy Grundman, Paul Harrington, Alexander Hartmaier David Hull, Robert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter, Brett Rann, Peter Rabbitson, Erik Selberg, Aaron Straup Cope, Lars Thegler, David Viner, Mac Yang.
|perl v5.20.3||CATALYST (3)||2015-04-18|