简体   繁体   中英

Google Appengine backend logging on local dev server

How do you get logging out of an appengine backend during local development? I tried logging, logservice.flush(). No luck.

Logging works, but the default logging level is WARNING , so logging.info() or logging.debug() won't show up.

You can set the logging level when starting your dev server:

dev_appserver.py --log_level=debug ...

From dev_appserver.py command-line arguments :

--log_level=...

The lowest logging level at which logging messages will be written to the console; messages of the specified logging level or higher will be output. Possible values are debug, info, warning, error, and critical.

You can also persist your logs to a file :

By default, logs are stored in memory only in the development server and are accessible if you wish to test the Logs API feature. If you wish to persist logs from the development server to disk at the default location /tmp/dev_appserver.logs, supply the --persist_logs command line option as follows:

 dev_appserver.py --persist_logs your-app-directory 

If you wish to persist the logs from the development server to disk at a location of your own choosing, supply the desired path and filename to the --logs_path command line option as follows:

 dev_appserver.py --logs_path=your-path/your-logfile-name your-app-directory 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM