Config::Any::Log4perl - Config::Any loader for Log4perl config files
version 0.130020
use Config::Any; ... my $config = Config::Any->load_files({ files => \@files , use_ext => 1 , driver_args => { Log4perl => { config_name => 'logger' }} }); ...
See Config::Any
Loads Log4perl configuration files.
Example:
### sample.log4perl log4perl.logger = TRACE, SCREEN log4perl.appender.SCREEN = Log::Log4perl::Appender::Screen log4perl.appender.SCREEN.stderr = 1 log4perl.appender.SCREEN.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.SCREEN.layout.ConversionPattern = %d %-5p [%5P] %m%n
Return an array of valid extensions.
ARRAY - qw( log4perl ).
Attempts to load a Log4perl config file.
$file - SCALAR - The Log4perl config file.
$file
$args - HASHREF - optional - Possible options:
$args
config_name - A key used to store configuration.
HASHREF - Log4perl configuration.
With this Log4perl configuration file:
If config_name is undefined the return value is:
{ 'log4perl.appender.SCREEN.layout' => 'Log::Log4perl::Layout::PatternLayout', 'log4perl.appender.SCREEN.layout.ConversionPattern' => '%d %-5p [%5P] %m%n', 'log4perl.appender.SCREEN.stderr' => '1', 'log4perl.logger' => 'TRACE, SCREEN', 'log4perl.appender.SCREEN' => 'Log::Log4perl::Appender::Screen' }
If config_name is defined like this:
config_name => 'logger'
the return value is:
{ 'logger' => { 'log4perl.appender.SCREEN.layout' => 'Log::Log4perl::Layout::PatternLayout', 'log4perl.appender.SCREEN.layout.ConversionPattern' => '%d %-5p [%5P] %m%n', 'log4perl.appender.SCREEN.stderr' => '1', 'log4perl.appender.SCREEN' => 'Log::Log4perl::Appender::Screen', 'log4perl.logger' => 'TRACE, SCREEN' } }
Log::Log4perl
Loïc TROCHET <losyme@cpan.org>
This software is copyright (c) 2012 by Loïc TROCHET.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Config::Any::Log4perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Any::Log4perl
CPAN shell
perl -MCPAN -e shell install Config::Any::Log4perl
For more information on module installation, please visit the detailed CPAN module installation guide.