Converted to logging to file