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

I do not seem to be able to compile Apache::LogFile with modperl2. Should it work, and if not, what is the equivalent mothodology for logging to a flat file through the apache logging mechanism in modperl2?

Replies are listed 'Best First'.
Re: modperl1.99 custom logging
by PodMaster (Abbot) on Jul 22, 2004 at 02:05 UTC
    I don't think so. Try Apache::Log instead, it comes with mod_perl1 and mod_perl2(1.9x for now).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Near as I can tell, Apache::Log is only useful for writing to the standard Apache error log, not an arbitrary other file like Apache::LogFile. There must be a way to do this in modperl2, no?

        This might not address the original question but something I'm playing with is setting the log variables within a mod_perl handler and then using them from the .httpd.conf. Lots more goodies where this came from at perl.apache.org. Search 2.0 docs for "log."

        # in an mp handler $r->notes('SESSION', $some_id_value); # and then in the httpd.conf LogFormat "%h %{SESSION}n %l %u %t \"%r\" %>s %b ...et cetera

        Update: mp conf to httpd.conf.

        There must be a way to do this in modperl2, no?
        Sure. Simply open a file and write to it. You can use open or Log::Log4perl or anything.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.