I noticed when I was using AJAX requests to retrieve some stats, the Flask console was filling up with
127.0.0.1 - - [21/Apr/2015 13:29:25] "GET /servers/id/1/_api HTTP/1.1" 200 -
constantly. Is there a way to stop AJAX requests from being logged, or stop a certain URL from being logged?
Asked
Active
Viewed 295 times
1

Spideynn
- 67
- 1
- 13
-
possible duplicate of http://stackoverflow.com/questions/14888799/disable-console-messages-in-flask-server – economy Apr 21 '15 at 17:42
-
Check into using [Logging Filters](https://docs.python.org/dev/library/logging.html#filter-objects). Attach a filter to the [Flask logger](http://flask.pocoo.org/docs/0.10/api/#flask.Flask.logger) object. – sean Apr 21 '15 at 20:39
-
Logging filters seem to only filter out all of the connection messages, instead of doing a singular url – Spideynn Apr 21 '15 at 22:34
-
1I wrote a thing to do filtering like this: https://github.com/nathancahill/Flask-Logging – nathancahill Apr 21 '15 at 22:48
-
^ This actually does what I want. Thanks! – Spideynn Apr 22 '15 at 11:56