Practical mod_perl / HTML Book /



previous page: B.17.8. Apache::Log—Interface to Apache Logging
  
page up: HTML Version of the book
  
next page: B.17.10. Apache::Scoreboard—Perl Interface to Apache's scoreboard.h

B.17.9. Apache::LogFile—Interface to Apache's Logging Routines


The PerlLogFile directive from this package can be used to hook a Perl file handle to a piped logger or to a file open for appending. If the first character of the filename is a "|", the file handle is opened as a pipe to the given program. The file or program can be relative to the ServerRoot.

So if httpd.conf contains these settings:

PerlModule Apache::LogFile
PerlLogFile |perl/mylogger.pl My::Logger

in your code you can log to the My::Logger file handle:

print My::Logger "a message to the Log"

and it'll be piped through the perl/mylogger.pl script.

Available from CPAN. See the module manpage for more information.

 

Continue to:

  • prev: B.17.8. Apache::Log—Interface to Apache Logging
  • Table of Contents
  • next: B.17.10. Apache::Scoreboard—Perl Interface to Apache's scoreboard.h







TOP
previous page: B.17.8. Apache::Log—Interface to Apache Logging
  
page up: HTML Version of the book
  
next page: B.17.10. Apache::Scoreboard—Perl Interface to Apache's scoreboard.h


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com