Re: Read from Apache error.log

[prev] [thread] [next] [Date index for 2005/03/27]

From: Femi Oshagbemi
Subject: Re: Read from Apache error.log
Date: 12:30 on 27 Mar 2005
thanks Rodger,

I had Initially tried using 'eval' however it seemed to me that no 
exceptions were thrown by the function call within the eval {system...} but 
within the called program itself, I may be wrong. In either case that method 
brought me no success unfortunately.


>From: Rodger Castle <rodger@xxxxxxxxxxxxxxx.xxx>
>To: modperl@xxxx.xxxxxx.xxx
>Subject: Re: Read from Apache error.log
>Date: Sun, 27 Mar 2005 06:59:44 -0500
>
> > Hello, im very new to the perl, modperl and apache combination.
> >
>
>So am I, but I think I have a usable solution for you.
>
> > I am invoking another program from within my perl module using a
> > 'System(...)' call. Although the call is successfull, there are times 
>when
> > the invoked program may terminate with a 'parse error:' for example, 
>and
> > theses are logged in the error.log. Is there a way the catch or read 
>this as
> > it happens and display to the browser?
>
>Here's what I do ... add the line
>
>use Carp;
>
>to your Module list (checkout the perldocs on it for full details)
>
>Wrap your call in an 'eval {};' block.  Example ...
>
>eval
>{
>	System.call (...);      # This is the call that you're expecting an error 
>from
>};  ## Don't forget the semi-colon
>if ( $@ )
>{
>	$r->print ( "Uh oh. Error found: $@" );
>	carp ( $@ );
>}
>
>The eval acts as an exception handler.  There is some discussion on the 
>mod_perl site for using eval and Carp for exception handling.
>
>Hope the helps.
>
>Rodger


Read from Apache error.log
Femi Oshagbemi 11:47 on 27 Mar 2005

Re: Read from Apache error.log
Rodger Castle 11:59 on 27 Mar 2005

Re: Read from Apache error.log
Femi Oshagbemi 12:30 on 27 Mar 2005

Re: Read from Apache error.log
Rodger Castle 12:39 on 27 Mar 2005

Re: Read from Apache error.log
Clinton Gormley 14:08 on 27 Mar 2005

Re: Read from Apache error.log
Stas Bekman 15:08 on 27 Mar 2005

Generated at 09:30 on 27 Apr 2005 by mariachi v0.52