On Jan 12, 3:13 am, Patrick May <patrick....@codestreet.com> wrote:
> On Jan 5, 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?
>
> I'm still having this problem.  The relevant section of my httpd.conf
> looks like this:
>
> . . .
> LoadModule wsgi_module libexec/apache2/mod_wsgi.so
> . . .
> <IfModule wsgi_module>
>     WSGIScriptAlias /codestreet /Users/Patrick/codestreet/src/rest/
> django.wsgi
>
>     <Directory /Users/Patrick/codestreet/src/rest>
>     Order deny,allow
>     Allow from all
>     </Directory>
> </IfModule>
>
> My django.wsgi contains:
>
> import os
> import sys
>
> sys.path.append('/Users/Patrick/codestreet/src/rest')
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'server.settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> The only errors I see in /var/log/apache2/error_log are:
>
> [Mon Jan 11 11:12:05 2010] [error] [client ::1] mod_wsgi (pid=93049):
> Exception occurred processing WSGI script '/Users/Patrick/codestreet/
> src/rest/django.wsgi'.
> [Mon Jan 11 11:12:05 2010] [error] [client ::1] IOError: failed to
> write data
>
> I have had some successful invocations, so I know the request is
> getting to the appropriate handler.  Any thoughts?

But where are you putting the call to write messages to error log?

Add at start of your WSGI script file:

  import sys
  print >> sys.stderr, 'IMPORTING WSGI SCRIPT FILE'

Do what is needed for your configuration to ensure script file
reloaded. Then look in Apache error logs for message. Ensure you check
all virtual host specific error logs as well as the main Apache error
log in case the issue is that you are misunderstanding which log it
should appear in, or your Apache configuration is wrong and matching
virtual hosts wrong and so going to wrong log file.

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