All,
I am attempting my first testing of this module to understand how I can use it.
Here is my test Perl program:
use strict;
use warnings;
use Log::Log4perl qw/get_logger :levels/;
use FindBin qw/$Bin/;
use vars qw/$logger/;
BEGIN
{
Log::Log4perl->init(sprintf("%s/../cfg/oracle_logger.config", $FindBin::Bin));
$logger = Log::Log4perl->get_logger($0);
$logger->info("starting");
}
$logger->debug("attempting start");
END
{
$logger->info("end") if $logger;
}
Here is my config file:
log4perl.logger.test = INFO, test_app
log4perl.logger.test = WARN, test_app
log4perl.logger.test = DEBUG, test_app
log4perl.logger.test = ERROR, test_app
log4perl.logger.test = FATAL, test_app
log4perl.appender.test_app = Log::Log4perl::Appender::File
log4perl.appender.test_app.mode = append
log4perl.appender.test_app.filename = ../logs/test.log
log4perl.appender.test_app.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.test_app.layout.ConversionPattern = %d %p: %F{1}:%L
%c %M - %m%n
What happens here is the log file gets created, but nothing is written
to it. I have read the "tutorial" from the O'Reilly site, but I
cannot figure this out.
Thanks for your help.
--
Ron Reidy
Oracle DBA
|