Got it now. Yes you can use the logging module and send messages to a
file but there is a major problem. I believe the parameters of the
logging module are per-process and not per-thread (please check). This
means if redirecting logging to a file, all web2py logging (for the
framework and all apps) will be redirected to the file. I think you
should just open('filename','w').write('log:%s' % message)
I also suggest log into
os.path.join(request.folder,'private','error.log') and create a custom
action to retrieve the log file. In this way you have per-app logging
and you can choose the permissions you need.
Perhaps there should be a logging command in web2py to avoid the
problems with the logging module.
Massimo