I recently configured my app to use the new AppStats feature of GAE. However, while debugging it, the extremely verbose logging from AppStats is annoying & I'd like to disable it while I'm debugging and then turn it back on later. Surely there is a single line I can add to or modify in a config file that will let me do this.
views:
30answers:
1See the configuring appstats docs: configuration is performed by creating your own appengine_config.py
in your app's root directory. Best documentation of what you can do in that config file is the sample one supplied with your SDK, which you can also look at here. To disable stats, if you're using Django, just comment out the line
google.appengine.ext.appstats.recording.AppStatsDjangoMiddleware
in your Diango settings.py
file; if you're not using Django, in the function that should be in your appengine_config.py
file and read
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app
just comment out the first two lines of the body, so it reads instead
def webapp_add_wsgi_middleware(app):
# from google.appengine.ext.appstats import recording
# app = recording.appstats_wsgi_middleware(app)
return app
If you insist on it being a single-line change, you can avoid commenting the from
statement -- per se, it's innocuous, though it may microscopically slow you down (which is why I'd comment it out even though innocuous;-).