Skip to content

Instantly share code, notes, and snippets.



Forked from ibeex/foo.log
Last active Aug 29, 2015
What would you like to do?
A warning occurred (42 apples)
An error occurred
import logging
from logging.handlers import RotatingFileHandler
from flask import Flask
app = Flask(__name__)
def foo():
app.logger.warning('A warning occurred (%d apples)', 42)
app.logger.error('An error occurred')'Info')
return "foo"
if __name__ == '__main__':
handler = RotatingFileHandler('foo.log', maxBytes=10000, backupCount=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment