Start of logging to file (to make proxy useful again with new UI), but still has issues