perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: Logging With Mod Perl 2.0
Date Fri, 27 Apr 2007 09:00:01 GMT
On Thursday 26 April 2007 21:10, Tyler Bird wrote:
> But I was wondering isn't there anything I can do to mod_perl that will
> allow a plain warn to send it to my virtualhosts log and not my servers
> log.
>
> without using the $r->warn() syntax

The problem is you need a $r object for that. In MP1 there was a global one. 
In MP2 there is not.

Your problem can possibly be solved by using PerlOptions +GlobalRequest plus 
modifying the warn function by either setting $SIG{__WARN__} or 
*CORE::GLOBAL::warn=sub{...}

*CORE::GLOBAL::warn=sub {
  (Apache2::RequestUtil->request || Apache2::ServerUtil->server)->warn(@_);
}

Torsten

Mime
View raw message