Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log_file parameter is not logging to file #99

Closed
davoclavo opened this issue Mar 7, 2015 · 1 comment
Closed

log_file parameter is not logging to file #99

davoclavo opened this issue Mar 7, 2015 · 1 comment

Comments

@davoclavo
Copy link

I am trying to add an access log to my app running a Flask-SocketIO with the following call

log_filename = 'access.log'
socketio.run(app, host='0.0.0.0', port=80, log_file=log_filename)

It is creating the file but the file is blank. I digged a little bit and found that the log_file parameter is passed to the WSGIServer instance as a File object, which is never closed.

This is a valid workaround:

logger = logging.getLogger('werkzeug')
handler = logging.FileHandler(log_filename)
logger.addHandler(handler)
@miguelgrinberg
Copy link
Owner

The start up options have changed in release 1.0, so I'm closing this as it is outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants