Hi everybody. I'm trying to get logging module in webapp in Flask to work but to no result. What am I doing wrong? The file just don't get created. When I try this in Python console it works. See code attached.
@app.before_first_request
def logging_init():
logging.basicConfig(
datefmt = '%Y-%m-%d %H:%M:%S',
format = '%(asctime)s%%%(message)s',
filename = '/home/vmax/mysite/routing.log',
level=logging.CRITICAL)
@app.route('/')
def hello_world():
logging.critical('a request!')
return 'Hello from Flask!'