John Peterson - 2010-02-13

Hello

Am using Log-Log4perl-1.27

tst.pl

#!/usr/bin/perl
use Log::Log4perl;
Log::Log4perl->init("tst.conf");
$logger = Log::Log4perl->get_logger();
$logger->info ("info message");

tst.conf

log4perl.rootLogger=DEBUG, R1
log4perl.appender.R1=Log::Log4perl::Appender::File
log4perl.appender.R1.filename=/tmp/tst.log
log4perl.appender.R1.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.R1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n

This configuration works fine and am able to see the messages getting logged to /tmp/tst.log

But when I configure tst.conf as

log4perl.rootLogger=DEBUG, R1
log4perl.appender.R1=Log::Log4perl::JavaMap::RollingFileAppender
log4perl.appender.R1.filename=/tmp/tst.log
log4perl.appender.R1.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.R1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n

My program crashes without any warning or error message. Nothing gets logged to /tmp/tst.log
It crashes while executing the line Log::Log4perl->init("tst.conf");

# ls Log4perl/JavaMap
ConsoleAppender.pm  JDBCAppender.pm        RollingFileAppender.pm  TestBuffer.pm
FileAppender.pm     NTEventLogAppender.pm  SyslogAppender.pm

1) Could you please let me know, what is going wrong and how to fix this problem ?

2) Also when I configure the tst.conf with log4j appenders, it doesn't work. It crashes while executing the line Log::Log4perl->init("tst.conf"); Can you please let me know, how to fix this problem, please ?

Thank You in advance for your help.