Redirect Logging to File / Directory


When running a dash app, all the HTTP responses and errors are shown in the CLI by default. Is there a way in Dash to send this logging to a file or a file in a folder instead for debugging at a later time? Or any other ways to do this?



Googling “Flask file logger”, I found this:

Adapting this to Dash would look something like:

import logging
from logging.handlers import RotatingFileHandler

import dash

app = dash.Dash()

if __name__ == '__main__':
    handler = RotatingFileHandler('foo.log', maxBytes=10000, backupCount=1)

I haven’t tested this, but I’d recommend searching for something along these lines. Be sure to let us know what you end up with!

Flask 1.0 Release - Impact On Your Dash Apps

@tbone did chris’s solution work?
My file comes out empty.
Could you please share what you did