durusmail: quixote-users: where do mod_python print statements go?
where do mod_python print statements go?
2001-10-12
2001-10-12
2001-10-12
2001-10-12
2001-10-12
2001-10-12
2001-10-15
2001-10-15
2001-10-15
2001-10-15
2001-10-15
2001-10-15
2001-10-15
where do mod_python print statements go?
Ray Drew
2001-10-12
> -----Original Message-----
> From: Greg Ward [mailto:gward@mems-exchange.org]
> Sent: 12 October 2001 14:10
> To: quixote-users@mems-exchange.org
> Subject: Re: [Quixote-users] where do mod_python print statements go?
>
>
> On 12 October 2001, Ray Drew said:
> > running quixote 0.41 on win nt4, apache 1.3, mod_python
> >
> > I can't work out where python print statements are going.
> The _q_index()
> > print "debug..." statement prints to the debug file
> (specified in demo.conf)
> > when I run the demo under cgi. I've  specified DEBUG_LOG in
> config.py but
> > this doesn't seem to work. Do I have to change something else?
>
> If debug logging works with a CGI driver script, then there's nothing
> wrong with your config file.  Yes, DEBUG_LOG is all you need.
>
> Erno, can you confirm that debug logging works with mod_python under
> Unix?  This might be a mod_python thing, or might be a
> mod_python-under-NT thing.
>
> (Which reminds me, I really should finish getting mod_python
> running on
> my development machine, so I can try it out myself...)
>
> Ray, if you're curious enough to dig into this, the place to look is
> quixote/publish.py, in the setup_logs() method.  It's pretty darn
> simple:

I think the problem is that mod_python_handler.handler() doesn't call
setup_logs so the log files don't get set and sys.stdout doesn't get
re-directed. If you add a call to Publisher.setup_logs()..

    if not name2publisher.has_key(package):
        name2publisher[package] = ModPythonPublisher(package)
        name2publisher[package].setup_logs()
    return name2publisher[package].publish_modpython(req)

.. everything seems to work fine.

Ray Drew
CONFIDENTIALITY - The information in this e-mail and any attachment is
confidential and is intended only for the named recipient(s).  The E-mail
may not be disclosed or used by any person other than the addressee, nor may
it be copied in any way.  If you are not a named recipient please notify the
sender immediately and delete any copies of this message.


reply