You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "F.Xavier Noria" <fx...@isoco.com> on 2002/05/07 17:48:42 UTC

convention on logging?

I am writing a web application that uses Apache modules and core classes
in a MVC style.  AFAICT using $r->log->debug() is the standard way to
print debug messages in Apache modules, but which would be the right way
to print debug messages in the core classes provided both types of
modules are going to run together?

-- fxn

Re: convention on logging?

Posted by Perrin Harkins <pe...@elem.com>.
F.Xavier Noria wrote:
> I am writing a web application that uses Apache modules and core classes
> in a MVC style.  AFAICT using $r->log->debug() is the standard way to
> print debug messages in Apache modules, but which would be the right way
> to print debug messages in the core classes provided both types of
> modules are going to run together?

You can use Apache->server->log().  If you want your modules to work 
outside of mod_perl, you can write a wrapper class that uses the server 
log when it sees you are in mod_perl and uses something else when you're 
not.  There are several fancy logging modules on CPAN.

- Perrin


Re: Logging Perl errors to browser

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Jeff wrote:

> Folks,
> 
> How do I get to log my mod_perl handler Perl errors to the browser
> instead of into the Apache logs?


see recipes 4.5 and (the more interestingly but less robust) 16.6 in the cookbook

the code for each is here
   http://www.modperlcookbook.org/code/ch04/Cookbook/ErrorsToBrowser.pm
   http://www.modperlcookbook.org/code/ch16/Cookbook-DivertErrorLog-0.01.tar.gz

if you don't have the book you can see chapter 4 online at
   http://www.webreference.com/programming/perl/cookbook/

HTH

--Geoff





Logging Perl errors to browser

Posted by Jeff <ja...@aquabolt.com>.
Folks,

How do I get to log my mod_perl handler Perl errors to the browser
instead of into the Apache logs?

TIA
Jeff