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

I host my Catalyst web application with Apache2 and ModPerl. All works fine and fast so far. The web application uses the Log4perl modul to generate a logfile.

The problem is that only log entries are generated when the apache service is starting. Afterwards no new entries were generated.

If I use the integrated development server of catalyst instead, log entries are generated normaly.

I already checked the access rights and these seem ok: the apache process is owner and can write.

Can anyone help me with this prolbem ?!?

This is my log4perl config:

#log4perl.logger.myapp=INFO, LOGFILE # --> i tried this first but without success log4perl.rootLogger=INFO,LOGFILE log4perl.appender.LOGFILE=Log::Log4perl::Appender::File log4perl.appender.LOGFILE.filename=myapp.log log4perl.appender.LOGFILE.mode=append log4perl.appender.LOGFILE.layout=PatternLayout log4perl.appender.LOGFILE.layout.ConversionPattern=[%d] [%p] %m%n

Replies are listed 'Best First'.
Re: Log4perl & Apache
by Anonymous Monk on Apr 24, 2013 at 11:08 UTC

    log4perl.appender.LOGFILE.filename=myapp.log

    Try using an absolute path

    It also might be critical to know how host your Catalyst web application with Apache2 and ModPerl. and how you pass your log4perl configuration

        Thanks for the link. I use Log::Log4perl::Catalyst (part of the Log::Log4perl package), so Log4perl is automatically initialized only once. I modified my config so log4perl in no longer async
        log4perl.rootLogger = INFO, Syncer log4perl.appender.Syncer = Log::Log4perl::Appender::Synchronized log4perl.appender.Syncer.appender = LOGFILE log4perl.appender.LOGFILE=Log::Log4perl::Appender::File .... ....
        but still no furhter log entries were generated, only the inital one during apache startup. This is how i integrate log4perl:
        use Log::Log4perl::Catalyst; .... __PACKAGE__->log(Log::Log4perl::Catalyst->new(__PACKAGE__->path_to('lo +g4perl.conf')->stringify)); ....