You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/02/10 17:20:20 UTC

Apache::LogSTDERR

Brian, will you have a chance to commit Apache::LogSTDERR to CPAN or
mod_perl source? You said you will, it's still not there, so I'm kinda
puzzled whether to document this one in the book or not. Thanks.

I think it was first mentioned here:
http://forum.swarthmore.edu/epigone/modperl/vixquimwhen

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:stas@stason.org   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



Re: Apache::LogSTDERR

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sun, 18 Feb 2001, Doug MacEachern wrote:

> On Sun, 18 Feb 2001, Matt Sergeant wrote:
>  
> > While both work, they still suffer from all the extraneous info that
> > 1.3+ logging outputs: "[Date] [leve]", or for info: "[Date] [level]
> > [ip]". Rather annoying.
> 
> right.  the code that redirects stderr to the r->server->error_log lives
> in mod_perl.c:
> 
> #ifndef PERL_TRACE
>     if(r->server->error_log) 
> 	error_log2stderr(r->server);
> #endif

Yeah I saw that and even checked the older source to see if it had changed
since 1.24_01, which it hasn't. This makes me thing its an Apache 1.3.17
thing, rather than a mod_perl thing.

> i wonder if you have PERL_TRACE on?  or it isn't being called for some
> reason, or being called to early before r->server points to the
> virtualhost thats serving the request.

That sounds more likely to me...

> changing to this might shed some light:
> 
>     if(r->server->error_log) {
>         fprintf(stderr, "hooking stderr to %s for host %s\n",
>                 r->server->error_fname, ap_get_server_name(r));
> 	error_log2stderr(r->server);
>     }

Interesting - I did this and didn't get any output anywhere - not in the
logs, nor in the output when I ran httpd -X. So I removed the #ifdefs, and
got exactly the same! Something seriously fishy going on.

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\



Re: Apache::LogSTDERR

Posted by Doug MacEachern <do...@covalent.net>.
On Sun, 18 Feb 2001, Matt Sergeant wrote:
 
> While both work, they still suffer from all the extraneous info that
> 1.3+ logging outputs: "[Date] [leve]", or for info: "[Date] [level]
> [ip]". Rather annoying.

right.  the code that redirects stderr to the r->server->error_log lives
in mod_perl.c:

#ifndef PERL_TRACE
    if(r->server->error_log) 
	error_log2stderr(r->server);
#endif

i wonder if you have PERL_TRACE on?  or it isn't being called for some
reason, or being called to early before r->server points to the
virtualhost thats serving the request.
changing to this might shed some light:

    if(r->server->error_log) {
        fprintf(stderr, "hooking stderr to %s for host %s\n",
                r->server->error_fname, ap_get_server_name(r));
	error_log2stderr(r->server);
    }


Re: Apache::LogSTDERR

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sun, 18 Feb 2001, Doug MacEachern wrote:

> On Thu, 15 Feb 2001, Matt Sergeant wrote:
> 
> i haven't tried this yet, but curious if:
> 
> use Apache qw(warn);
> will make a difference.
> 
> or changing 'warn ...' to '$r->log->warn(...)'

While both work, they still suffer from all the extraneous info that
1.3+ logging outputs: "[Date] [leve]", or for info: "[Date] [level]
[ip]". Rather annoying.

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\



Re: Apache::LogSTDERR

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 15 Feb 2001, Matt Sergeant wrote:

i haven't tried this yet, but curious if:

use Apache qw(warn);
will make a difference.

or changing 'warn ...' to '$r->log->warn(...)'


Re: Apache::LogSTDERR

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 14 Feb 2001, Doug MacEachern wrote:

> On Wed, 14 Feb 2001, Matt Sergeant wrote:
>
> > Gotcha... So any idea what my bug is then? I had to switch everything to
> > info logs, which has *way* too much information for my debugging needs.
>
> nope, haven't had a chance to look yet.  if you want to speed it up, work
> up an httpd.conf entry, request, etc., what should be expected in what
> log, etc., that i can drop in to reproduce.  use whatever host/ips, i can
> edit my /etc/hosts or whatever to make it work.

package FooTest;
use Apache::Constants;
use Apache::Request;
use Apache::Reload;
use Apache::Log;

sub handler {
        my $r = shift;# Apache::Request->new(shift);

        warn "Warn to which log?\n";

        $r->log->info("Info to which log?\n");

        $r->send_http_header;
        print "Args: ", scalar $r->args, "\n";
        return OK;
}

1;

<VirtualHost 194.70.26.133>
ServerName www.sergeant.org
ServerAlias sergeant.org
DocumentRoot /home/matt/Web/www.sergeant.org
ErrorLog /home/matt/Web/Logs/www.error
CustomLog /home/matt/Web/Logs/www.log combined

 <Location /footest>
  SetHandler perl-script
  PerlHandler FooTest
 </Location>

</VirtualHost>

in /home/matt/Web/Logs/www.error we get:

[Thu Feb 15 11:53:31 2001] [info] [client 194.70.26.133] Info to which
log?

and in /opt/apache/logs/error_log (server's error log) we get:

Warn to which log?

Apache 1.3.17 and mod_perl 1.25. I upgraded both at the same time so I'm
not sure which one is causing the problem, but my httpd.conf wasn't
modified from before the upgrade.

Oh, and config directives are segfaulting again with 1.25 :-) I'm
seriously considering just shipping AxKit with a pre-compiled AxKit.xs
that I know works (i.e the one from mod_perl 1.24_01)...

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Apache::LogSTDERR

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 14 Feb 2001, Matt Sergeant wrote:
 
> Gotcha... So any idea what my bug is then? I had to switch everything to
> info logs, which has *way* too much information for my debugging needs.

nope, haven't had a chance to look yet.  if you want to speed it up, work
up an httpd.conf entry, request, etc., what should be expected in what
log, etc., that i can drop in to reproduce.  use whatever host/ips, i can
edit my /etc/hosts or whatever to make it work.


Re: Apache::LogSTDERR

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 14 Feb 2001, Doug MacEachern wrote:

> > I think it was first mentioned here:
> > http://forum.swarthmore.edu/epigone/modperl/vixquimwhen
> 
> matt, read this, it explains what it does.

Gotcha... So any idea what my bug is then? I had to switch everything to
info logs, which has *way* too much information for my debugging needs.

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\



Re: Apache::LogSTDERR

Posted by Doug MacEachern <do...@covalent.net>.
> I think it was first mentioned here:
> http://forum.swarthmore.edu/epigone/modperl/vixquimwhen

matt, read this, it explains what it does.


Re: Apache::LogSTDERR

Posted by brian moseley <bc...@maz.org>.
On Wed, 14 Feb 2001, Doug MacEachern wrote:

> On Sun, 11 Feb 2001, Stas Bekman wrote:
>
> > Brian, will you have a chance to commit Apache::LogSTDERR to CPAN or
> > mod_perl source? You said you will, it's still not there, so I'm kinda
> > puzzled whether to document this one in the book or not. Thanks.
>
> he was getting it ready todo it last week, i asked him not to upload it
> to cpan.  2 reasons:
> - there's some bogusness i want to change first
> - i cannot maintain the module, we need to find somebody else, like what
>   happened for Apache::PerlVINC

i don't want to maintain it either. i've got a tarball
prepared if anybody wants to take it off my hands and put it
on cpan.


Re: Apache::LogSTDERR

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 14 Feb 2001, Matt Sergeant wrote:
 
> What does it do? 

redirects stderr or something, its been so long, i don't even remember.

> Does it by any chance fix the broken logging to the
> server log rather than the request log in Apache 1.3.17?

no.


Re: Apache::LogSTDERR

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 14 Feb 2001, Doug MacEachern wrote:

> On Sun, 11 Feb 2001, Stas Bekman wrote:
> 
> > Brian, will you have a chance to commit Apache::LogSTDERR to CPAN or
> > mod_perl source? You said you will, it's still not there, so I'm kinda
> > puzzled whether to document this one in the book or not. Thanks.
> 
> he was getting it ready todo it last week, i asked him not to upload it
> to cpan.  2 reasons:
> - there's some bogusness i want to change first
> - i cannot maintain the module, we need to find somebody else, like what
>   happened for Apache::PerlVINC

What does it do? Does it by any chance fix the broken logging to the
server log rather than the request log in Apache 1.3.17?

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\



Re: Apache::LogSTDERR

Posted by Doug MacEachern <do...@covalent.net>.
On Sun, 11 Feb 2001, Stas Bekman wrote:

> Brian, will you have a chance to commit Apache::LogSTDERR to CPAN or
> mod_perl source? You said you will, it's still not there, so I'm kinda
> puzzled whether to document this one in the book or not. Thanks.

he was getting it ready todo it last week, i asked him not to upload it
to cpan.  2 reasons:
- there's some bogusness i want to change first
- i cannot maintain the module, we need to find somebody else, like what
  happened for Apache::PerlVINC