How to make logging.debug work on Appengine?
I'm having a tough time getting the logging on Appengine 开发者_Python百科working. the statement
import logging
is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an Eclipse issue, so I tried calling
logging.debug("My debug statement")
which does not print anything out on the dev_appserver. I haven't seen anything here
http://code.google.com/appengine/docs/python/runtime.html#Logging
that is very helpful on the matter. Any advice is much appreciated.
The problem is most likely with the setup of the dev_appserver. Try running it with the -d flag to turn on debugging.
I have experience only with the Java App Engine, but there they set things up to only log WARN and ERROR. Try using one of those and see if you start getting output!
I'm sure there are ways to loosen the filter, but I wouldn't know how to do it in Python.
Use the command option --log_level
$ dev_appserver.py --host 127.0.0.1 --log_level=debug .
精彩评论