10

Do you know how to change the logging level of Google App Engine dev_appserver?
I would like to set it to ERROR removing messages like:

INFO     2011-10-18 17:43:00,806 dev_appserver_multiprocess.py:637] 
         Running application foo on port 8106: http://localhost:8106
INFO     2011-10-18 17:47:12,927 dev_appserver.py:4247] 
         "GET /images/sprite.png HTTP/1.1" 200 -
systempuntoout
  • 71,966
  • 47
  • 171
  • 241

5 Answers5

20

There are two slightly different arguments which let you control the log level, log_level and dev_appserver_log_level.


log_level {debug,info,warning,critical,error}
dev_appserver.py --log_level=debug

The log level below which logging messages generated by application code will not be displayed on the console (default: info)


dev_appserver_log_level {debug,info,warning,critical,error}
dev_appserver.py --dev_appserver_log_level=debug

The log level below which logging messages generated by the development server will not be displayed on the console (default: info)

joshhunt
  • 5,197
  • 4
  • 37
  • 60
Diederik
  • 5,536
  • 3
  • 44
  • 60
  • 1
    Answer is missing an equal sign but is on the right track. Try --log_level=debug. For more info: https://developers.google.com/appengine/docs/python/tools/devserver – Corey Burke May 22 '14 at 19:26
  • 5
    I struggled a bit, it looks in the bottom of `--help` there is another argument you can pass named `--dev_appserver_log_level` which controls the output successfully. – topless Aug 27 '14 at 09:41
3

The accepted answer does not work for me, but the comments to the accepted answer do give a fix. This is a community wiki answer to help avoid confusion.

dev_appserver.py --dev_appserver_log_level=debug sets the log output to debug level.

new name
  • 15,861
  • 19
  • 68
  • 114
3

Looking at the code, there isn't a way to modify the log level from the command line. Your solution is fine (at least until the next update, as you said).

You could pipe it through a GREP if you want, eg.:

~/google_appengine/dev_appserver.py . 2>&1 |egrep "^(WARNING|ERROR|CRITICAL)"

Not ideal but functional.

Moishe Lettvin
  • 8,462
  • 1
  • 26
  • 40
0

In the Google App Engine Launcher select Edit->Application Settings, and add --debug into Extra Command Line Flags.

Ricky Jones
  • 134
  • 1
  • 6
0

I have directly modified the source of dev_appserver_main.py in:

ARG_LOG_LEVEL: logging.ERROR

On the next update I will lose this change but it is not a problem; I really wanted this because log console tend to freeze on huge imports from program (I'm on OSX).

systempuntoout
  • 71,966
  • 47
  • 171
  • 241