That is one of the problems when using WSGI, all output to STDOUT is used
for the server response and STDIN is used for the application input

To get arround this, output to files must be directed to STDERR, otherwise
you will mess up your servers response string.

sys.stdout = sys.stderr

http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html

-Thadeus




On Mon, Sep 28, 2009 at 5:53 PM, Richard <richar...@gmail.com> wrote:

>
> I have found that logging is effected by the server you are using. For
> the builtin web2py server my logging works, but for Apache with WSGI
> the logging gets redirected to standard error.
> Is the logging being redirected to your server error/output log files?
>
> Richard
>
>
> On Sep 28, 10:32 pm, Roar <roar.skulles...@gmail.com> wrote:
> > I've added the following to the default.py controller:
> >
> > import logging
> > LOG_FILENAME = '/tmp/log/log.txt'
> > logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,)
> >
> > logging.debug('This message should go to the log file, but it does
> > not')
> >
> > ...but nothing is being logged. Any ideas?
> >
>

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

Reply via email to