You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently ran into #70 for exactly the same reason, and tried HARD to add an error log to capture exceptions. For the life of me couldn't figure out why it didn't work. I'm not familiar enough with Flask but followed all the docs and stackoverflow answers I could find.
It created the log file fine, but didn't output exceptions no matter what I tried.
Here's what I put in daemon.py, would be great if someone could make it work:
# fixes formatting character code outputimportwerkzeugwerkzeug.serving._log_add_style=Falsedeflogfile_handler():
importlogginghandler=logging.handlers.RotatingFileHandler(
"/var/log/mailinabox.err.log",
maxBytes=100000,
backupCount=1,
)
handler.setLevel(logging.INFO)
returnhandler# I tried lots of things to make this work!!@app.errorhandler(Exception)deflog_exception(e):
app.logger.error("Exception")
returne
....
# after the create_syslog_handler() lineapp.logger.addHandler(logfile_handler())
The text was updated successfully, but these errors were encountered:
I recently ran into #70 for exactly the same reason, and tried HARD to add an error log to capture exceptions. For the life of me couldn't figure out why it didn't work. I'm not familiar enough with Flask but followed all the docs and stackoverflow answers I could find.
It created the log file fine, but didn't output exceptions no matter what I tried.
Here's what I put in
daemon.py
, would be great if someone could make it work:The text was updated successfully, but these errors were encountered: