I have a custom management command which starts a Tornado loop in order to listen to websocket events. That loops writes its output to the console, which i want to redirect to a log file. I read the Django Docs about Custom Management Commands, but still have no clue how to do it.
The relevent bits of code of my command which is based on sockjs-tornado:
from tornado import web, ioloop
ioloop.IOLoop.instance().start()