MooseX::Log::Log4perl man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

MooseX::Log::Log4perl(User Contributed Perl DocumentatMooseX::Log::Log4perl(3)

NAME
       MooseX::Log::Log4perl - A Logging Role for Moose based on Log::Log4perl

SYNOPSIS
	package MyApp;
	use Moose;
	use Log::Log4perl qw(:easy);

	with 'MooseX::Log::Log4perl';

	BEGIN {
	  Log::Log4perl->easy_init();
	}

	sub foo {
	  my ($self) = @_;
	  $self->log->debug("started bar");    ### logs with default class catergory "MyApp"
	  ...
	  $self->log('special')->info('bar');  ### logs with category special
	}

DESCRIPTION
       A logging role building a very lightweight wrapper to Log::Log4perl for
       use with your Moose classes.  The initialization of the Log4perl
       instance must be performed prior to logging the first log message.
       Otherwise the default initialization will happen, probably not doing
       the things you expect.

       For compatibility the "logger" attribute can be accessed to use a
       common interface for application logging.

       For simple logging needs use MooseX::Log::Log4perl::Easy to directly
       add log_<level> methods to your class instance.

	   $self->log_info("Dummy");

ACCESSORS
   logger
       The "logger" attribute holds the Log::Log4perl object that implements
       all logging methods for the defined log levels, such as "debug" or
       "error". As this method is defined also in other logging roles/systems
       like MooseX::Log::LogDispatch this can be thought of as a common
       logging interface.

	 package MyApp::View::JSON;

	 extends 'MyApp::View';
	 with 'MooseX:Log::Log4perl';

	 sub bar {
	   $self->logger->debug("Something could be crappy here");     # logs a debug message
	   $self->logger->debug("Something could be crappy here");     # logs a debug message
	 }

   log([$category])
       Basically the same as logger, but also allowing to change the log
       category for this log message.

	if ($myapp->log->is_debug()) {
	    $myapp->log->debug("Woot"); # category is class myapp
	}
	$myapp->log("TempCat")->info("Foobar"); # category TempCat
	$myapp->log->info("Grumble"); # category class again myapp

SEE ALSO
       Log::Log4perl, Moose, MooseX::LogDispatch

BUGS AND LIMITATIONS
       Please report any bugs or feature requests to
       "bug-moosex-log4perl@rt.cpan.org", or through the web interface at
       <http://rt.cpan.org>.

       Or come bother us in "#moose" on "irc.perl.org".

AUTHOR
       Roland Lammel "<lammel@cpan.org>"

       Inspired by the work by Chris Prather "<perigrin@cpan.org>" and Ash
       Berlin "<ash@cpan.org>" on MooseX::LogDispatch

CONTRIBUTORS
       In alphabetical order:

       Michael Schilli "<m@perlmeister.com>" for Log::Log4perl and suggestions
       in the interface.
       Tim Bunce "<TIMB@cpan.org>" for corrections in the
       MooseX::Log::Log4perl::Easy module.

LICENCE AND COPYRIGHT
       Copyright (c) 2008-2010, Roland Lammel "<lammel@cpan.org>",
       http://www.quikit.at. Some rights reserved.

       This module is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself. See perlartistic.

perl v5.14.1			  2010-04-30	      MooseX::Log::Log4perl(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net