NAME

Log::Dispatch::Config::Category - Named logger class

SYNOPSIS

use Log::Dispatch::Config::Category;
Log::Dispatch::Config::Category->configure(Foo => 'foo.conf');
Log::Dispatch::Config::Category->configure(Bar => 'Bar.conf');

my $foo = Log::Dispatch::Config::Category->instance('Foo');
my $bar = Log::Dispatch::Config::Category->instance('Bar');

DESCRIPTION

Log::Dispatch::Config::Category is an utility for Log::Dispatch::Config which provides a way to name Logger instances with their own unique names. Maybe useful for persistent environment like mod_perl.

The word category is chosen from log4j's one. Note that the concept is same, but the interface (how to define category) is different.

BEHIND THE SCENES

Log::Dispatch::Config::Category is not a subclass of Log::Dispatch::Config, but configure() call makes subclasses at run-time (hackish!)

For example,

Log::Dispatch::Config::Category->configure(Foo => 'foo.conf');

will result to:

package Log::Dispatch::Config::Category::Foo;
use base qw(Log::Dispatch::Config);

TODO

  • Defines default logger for not confgured name. log4j has root for it.

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

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

SEE ALSO

Log::Dispatch::Config