NAME

MooseX::Log::Log4perl::Easy - A Logging Role with easy interface for Moose based on MooseX::Log::Log4perl

VERSION

This document describes MooseX::Log::Log4perl::Easy version 0.2.1

SYNOPSIS

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

with 'MooseX::Log::Log4perl::Easy';

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

sub foo {
  my ($self) = @_;
  $self->log_debug("started bar");    ### logs with default class catergory "MyApp"
  $self->log_info('bar');  ### logs an info message
  $self->log('AlsoPossible')->fatal("croak"); ### log
}

DESCRIPTION

The Easy logging role based on the MooseX::Log::Log4perl logging role for Moose directly adds the logmethods for all available levels to your clas instance. Hence it is possible to use

$self->log_info("blabla");

without having to access a seperate log attribute as in MooseX::Log::Log4perl;

ACCESSORS

logger

See MooseX::Log::Log4perl

log

See MooseX::Log::Log4perl

log_fatal

Logs a fatal message using the logger attribute. Same as calling

$self->logger->fatal

log_error

Logs an error message using the logger attribute. Same as calling

$self->logger->error

log_warn

Logs a warn message using the logger attribute. Same as calling

$self->logger->warn

log_info

Logs an info message using the logger attribute. Same as calling

$self->logger->info

log_debug

Logs a debug message using the logger attribute. Same as calling

$self->logger->debug

log_trace

Logs a trace message using the logger attribute. Same as calling

$self->logger->trace

SEE ALSO

MooseX::Log::Log4perl, Log::Log4perl, Moose

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 suggestions by Michael Schilli <m@perlmeister.com>

LICENCE AND COPYRIGHT

Copyright (c) 2008, Roland Lammel <lammel@cpan.org>. 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.