2009/8/17 gert <[email protected]>:
>
> I expected at least this message to show up in my log ?
>
> print('query=',query,file=sys.stderr)
> or some trace back where syntax is wrong ?
> I only get a 500, I usually get at least some sign about the thing i
> did wrong in the logs ?
Try:
print('query=',query,file=environ['wsgi.errors'])
If there is a problem I haven't seen, then that may work where the
other doesn't. If that doesn't work either, much deeper issue.
FWIW, I did change how logging worked for Python 3.X. In my tests on
MacOS X it was working with Python 3.1. I didn't try with Python 3.0,
so chance it doesn't work for that.
I'll look later when get a chance.
Graham
> On Aug 16, 11:17 pm, Graham Dumpleton <[email protected]>
> wrote:
>> 2009/8/16 gert <[email protected]>:
>>
>>
>>
>> > this does not show any error messages in apache log ?
>>
>> Is this noise, or are you pointing out a specific problem I need to
>> look at. If a problem, you need to explain what it is, I am not going
>> to try each of these examples to try and find out.
>>
>> Graham
>>
>> > [Sun Aug 16 14:57:12 2009] [info] [client 192.168.2.17] mod_wsgi
>> > (pid=5791, process='www', application=''): Loading WSGI script '/usr/
>> > httpd/www/appwsgi/wsgi/upload2.wsgi'.
>>
>> > import os,sys
>> > def application(environ, response):
>> > #query=environ.get['QUERY_STRING']
>> > query=os.path.join(os.path.dirname(__file__),'teeeeeeeeeemp')
>> > print('query=',query,file=sys.stderr)
>> > range=environ.get('HTTP_RANGE','bytes=0-').replace
>> > ('bytes=','').split(',')
>> > offset=[]
>> > for r in range: offset.append(r.split('-'))
>> > with open(query,'wb') as f
>> > f.seek(offset[0][0])
>> > while True:
>> > chunk=environ['wsgi.input'].read(8192).decode('latin1')
>> > if not chunk: break
>> > f.write(chunk)
>> > l=os.fstat(f.fileno()).st_size
>> > response('200 OK', [('Content-Type', 'text/plain'), ('Content-
>> > Length', str(len(l)))])
>> > return [l]
>>
>> > User www
>> > Group www
>> > Listen 80
>> > Listen 443
>> > ServerRoot "/usr/httpd"
>> > ServerAdmin [email protected]
>> > ServerName 192.168.2.17
>> > DocumentRoot "www"
>> > LogLevel info
>> > ErrorLog "logs/httpd.log"
>> > DefaultType text/plain
>> > AddDefaultCharset utf-8
>>
>> > <Directory />
>> > Options ExecCGI Indexes FollowSymLinks
>> > Allow from all
>> > DirectoryIndex index.htm
>> > </Directory>
>>
>> > LoadModule ssl_module modules/mod_ssl.so
>> > SSLSessionCache dbm:logs/ca
>> > SSLCertificateFile conf/ca.crt
>> > SSLCertificateKeyFile conf/ca.key
>> > SSLEngine off
>>
>> > LoadModule wsgi_module modules/mod_wsgi.so
>> > WSGIDaemonProcess www python-path=/usr/httpd/www user=www group=www
>> > processes=1 threads=1 display-name="wsgi: www"
>> > WSGIProcessGroup www
>> > WSGIApplicationGroup %{GLOBAL}
>> > WSGIChunkedRequest On
>> > WSGILazyInitialization On
>> > WSGIRestrictEmbedded On
>>
>> > LoadModule mime_module modules/mod_mime.so
>> > AddHandler wsgi-script .wsgi
>> > AddType text/css .css
>> > AddType text/javascript .js
>> > AddType application/xhtml+xml .htm
>> > AddType application/x-shockwave-flash .swf
>> > AddType video/x-flv .flv
>> > AddType audio/mpeg .mp3
>> > AddType image/png .png
>> > AddType image/x-icon .ico
>>
>> > LoadModule deflate_module modules/mod_deflate.so
>> > AddOutputFilterByType DEFLATE text/html text/plain text/xml text/
>> > javascript text/css
>>
>> > LoadModule authz_host_module modules/mod_authz_host.so
>> > LoadModule autoindex_module modules/mod_autoindex.so
>> > LoadModule dir_module modules/mod_dir.so
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---