1

I host my Catalyst web application with Apache2 and ModPerl. The web application uses the Log4perl modul to generate logfiles.

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.

Anyone a idea what causes this problem???

This is my log4perl config:

log4perl.logger.myapp=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

Community
  • 1
  • 1
theguest
  • 83
  • 4

1 Answers1

0

I setup a test application running on Apache2 and mod_perl and I got this to work. Here were the notes that I took about it.

I used Log::Log4perl::Catalyst to do the logging within Catalyst. You mentioned using Log4perl, but I didn't know if you were using the Catalyst extension or not. In my main package, I had these lines:

use Log::Log4perl::Catalyst;
...
__PACKAGE__->log(Log::Log4perl::Catalyst->new('/full/path/to/l4p.conf'));

I did have to specify the full path to the log configuration file. I added a few logging statements to make sure that worked.

I used your sample above, but I did change one thing. I had to specify a full path to the log location again:

log4perl.appender.LOGFILE.filename=/full/path/to/myapp.log

Once I did those things, hitting the main site updated the log file.

Joel
  • 3,435
  • 2
  • 23
  • 33