Updated log to use an absolute path.

doc_update
Etzelia 2018-09-12 12:31:20 -05:00 committed by GitHub
parent 212e131b42
commit 6a2d867a47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -154,8 +154,8 @@ def setup_logging(config):
bot_info_logger = logging.getLogger('geoffrey.bot')
bot_info_logger.setLevel(logging.INFO)
handler = handlers.TimedRotatingFileHandler(filename='Geoffrey.log', when='D',
interval=config.rotation_duration, backupCount=config.count,
handler = handlers.TimedRotatingFileHandler(filename="{}/Geoffrey.log".format(path.dirname(path.abspath(__file__))),
when='D', interval=config.rotation_duration, backupCount=config.count,
encoding='utf-8')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))