diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index 63499977..ee683840 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -700,7 +700,7 @@ class LogEngine(object): if not filename: filename = 'vt_' + datetime.now().strftime('%Y%m%d') + '.log' filepath = getTempPath(filename) - self.fileHandler = logging.FileHandler(filepath) + self.fileHandler = logging.FileHandler(filepath, mode='w', encoding='utf-8') self.fileHandler.setLevel(self.level) self.fileHandler.setFormatter(self.formatter) self.logger.addHandler(self.fileHandler)