views:

46

answers:

2

Dev_appserver.py (the local development server for Python google app engine) spews tons of useless INFO messages. I would like to up this to WARN or ERROR. How can I do that?

I've tried the following, but it has no effect...

logger = logging.getLogger()
logger.setLevel(logging.WARN)

Any ideas?

A: 

Check if you have

      <!-- Configure java.util.logging -->
  <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
  </system-properties>

in your appengine-web.xml file, then go on to change .level = WARNING in your logging.properties file.

That's it!

Ashwin Prabhu
Thanks Ashwin. Sorry, I didn't realize the Java version had a dev_appserver too. I actually use Python, so my question is about python logging. I'll clarify :)
willem
+1  A: 

Currently, from the command line, you can only lower the logging level to DEBUG by the '-d' command line option.


If you're not afraid of editing the scripts, look for

DEFAULT_ARGS = {
  ...
  ARG_LOG_LEVEL: logging.INFO,

in C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_main.py

refack
Very very useful. Thanks!
willem