crypix has asked for the wisdom of the Perl Monks concerning the following question:

I humbly ask the great monks for help with a perl problem that is driving me crazy. I am writting a program on windows and I need a logging facility. I decided to use log::log4perl, wich I have used in the pass on *nx systems and it works wonderful.

But for some reason, I cannot get it do nothing on windows. I am using an external config file (logger.conf) part of it is shown below (this is the INFO facility config but all others are in the same format:

log4perl.logger=INFO, INFOLOGFILE log4perl.appender.INFOLOGFILE=Log::Log4perl::Appender::File log4perl.appender.INFOLOGFILE.filename=x:\\Code\\jas\\logger\\addenabl +e\info.log log4perl.appender.INFOLOGFILE.mode=append log4perl.appender.INFOLOGFILE.layout=PatternLayout log4perl.appender.INFOLOGFILE.layout.ConversionPattern=[%r]%F %L %c - +%m%n
and here is a snippet of code forcing an INFO message:
use Log::Log4perl qw(get_logger); Log::Log4perl->init('logger.conf'); $exitcode = 1; my $logger = get_logger(); if ($exitcode == 1){ $logger->info("Something went right"); }
Am I just not seeing something? Any advice or suggestions would be greatly appreciated. ~crypix

Replies are listed 'Best First'.
Re: log::log4perl on win32 not logging
by johnnywang (Priest) on Apr 13, 2005 at 18:49 UTC
    your code and config file works fine for me on my XP with activestate (5.8.3) and Log::Log4perl v0.40. (I assume your file path actually exists?)
Re: log::log4perl on win32 not logging
by ikegami (Patriarch) on Apr 13, 2005 at 19:33 UTC
    Is this in a script the web server executes or do you execute it from the prompt. Try running it from the prompt to check for permission problems.
      Thanks for responding
      The script is being run from the command line.
      I just got home and I am going to hack at it a little more and get back with you
      It's probably perl code delrium after 10 hour script days..argh

      ~crypix