fix: ログ出せた

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2022-07-01 14:57:43 +09:00
parent 77ad303506
commit af34d6a3d5
2 changed files with 3 additions and 4 deletions

View File

@ -11,9 +11,8 @@ def handler(event, context):
try:
logger.info('lambda handle')
raise FileNotFoundException('E-02-01', 'ファイル見つかりません')
except Exception as e:
logger.exception(f'exception: {e}')
# logger.exception(f'exception: {e.error_id} {e}')
except MeDaCaException as e:
logger.exception(f'exception: {e.error_id} {e}')
# ローカル実行用

View File

@ -16,7 +16,7 @@ class SingletonLogger:
LOG_FORMAT,
LOG_DATE_FORMAT
)
formatter.converter = lambda: datetime.datetime.now(ZoneInfo(DEFAULT_TIMEZONE)).timetuple()
formatter.converter = lambda *arg: datetime.datetime.now(ZoneInfo(DEFAULT_TIMEZONE)).timetuple()
for handler in logger.handlers:
handler.setFormatter(formatter)
level = logging.getLevelName(LOG_LEVEL)