[Flask] Control of werkzeug logging
Jason Harris
jason at unifiedthought.com
Tue Jul 21 19:17:43 CEST 2015
Hi I am using flask to serve an internal application on an embedded server. Ie the server and web page accessing the server reside on the same machine.
I have enabled logging in my application and have something like:
if __name__ == '__main__':
myLogger = logging.getLogger('myLogger')
myLogger.setLevel(logging.INFO)
myLoggerHandler = logging.handlers.RotatingFileHandler("mylogFile.log", maxBytes= 2*1024*1024, backupCount=3)
myLogger.addHandler(myLoggerHandler)
app.logger.addHandler(myLoggerHandler)
app.run(use_reloader=False)
I want however to be able to turn off the messages that werkzeug? is posting with each request to flask. Ie the output is littered with
127.0.0.1 - - [18/Jul/2015 19:01:52] "GET /myPacket/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:52] "GET /otherPacket/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:53] "GET /otherPacket/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:54] "GET /networkXYZ/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:54] "GET /simulationXYZ/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:54] "GET /otherPacket/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:55] "GET /otherPacket/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:56] "GET /networkXYZ/ HTTP/1.1" 200 -
127.0.0.1 - - [18/Jul/2015 19:01:56] "GET /simulationXYZ/ HTTP/1.1" 200 -
Where myPacket, otherPacket, networkXYZ, simulationXYZ are routes in my application. How or where do I control the print out / logging of this information?
Thanks!
Jason
More information about the Flask
mailing list