ben
ben

Reputation: 21

How to make logging.debug work on Appengine?

I'm having a tough time getting the logging on Appengine 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.

Upvotes: 2

Views: 200

Answers (3)

John Mee
John Mee

Reputation: 52323

Use the command option --log_level

$ dev_appserver.py --host 127.0.0.1 --log_level=debug .

Upvotes: 0

Ben
Ben

Reputation: 5087

The problem is most likely with the setup of the dev_appserver. Try running it with the -d flag to turn on debugging.

Upvotes: 3

Carl Smotricz
Carl Smotricz

Reputation: 67800

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.

Upvotes: 1

Related Questions