0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Lambda実行時のログ出力方法(Python)

Posted at

概要

Lambda実行時のログ出力方法を簡単に記す。
ロググループの作成や紐づけ方法は記載しない。(気が乗れば追記するやも)

実行環境

Python3.11

lambda_function.py
import logging

# logger初期化
logger = logging.getLogger()
logger.setLevel(logging.INFO)


def lambda_handler(event, context):
    """
    - 基本的なlog出力

    Args:
        - event: Lambda event
        - context: Lambda実行コンテキスト
    Return:
        なし
    """
    logger.info('INFOログ')
    logger.warn('WARNINGログ')
    logger.error('ERRORログ')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?