On Jan 6, 6:29 am, Karen Tracey <kmtra...@gmail.com> wrote:
> On Tue, Jan 5, 2010 at 2:22 PM, Patrick May <patrick....@codestreet.com>wrote:
>
>
>
>
>
> > On Jan 5, 2:18 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> > > On Tue, Jan 5, 2010 at 1:55 PM, Patrick May <patrick....@codestreet.com
> > >wrote:
>
> > > >                  I’m running Django using mod_wsgi under Apache.  I’m
> > > > trying to write messages to the Apache error log with:
>
> > > >                 sys.stderr.write(‘Message…’)
>
> > > > but for some reason they don’t appear.  This is under OS X (Snow
> > Leopard).
> > > > Do I have to configure something in httpd.conf to enable this?
>
> > > Do you also include sys.stderr.flush() ?
>
> > No, I thought that mod_wsgi did the flush automatically (from some
> > reading on the web).
>
> That's not been my experience.  Without an explicit call to .flush() I don't
> see the data written to sys.stderr appearing in the log file immediately.

It should auto flush on a newline being output if using
sys.stderr.write().

When using 'print >> sys.stderr', the 'print' adds a newline
automatically and so many wouldn't realise that it is the newline that
causes a flush to occur.

Graham
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to