Amazon Q Developer(Chatbot)でイベントログを有効にする方法を教えてください

Amazon Q Developer(Chatbot)でイベントログを有効にする方法を教えてください

Clock Icon2025.05.23

困っていた内容

Amazon Q Developer(旧 AWS Chatbot)を使ってイベントを Slack に通知する仕組みを構築中です。
デバッグのためイベントのログを確認したいです。
AWS Chatbot のイベントログを有効にする方法を教えてください。

どう対応すればいいの?

チャンネル設定で「ログ記録」を設定してください。

AmazonQ Chatbot Enable Event Log 5

Amazon Q Developer でログ記録を有効にすると、配信されたイベント内容や結果等が CloudWatch Logs に出力されます。

ログ配信は二つのログレベルが選択できるため、状況に応じて選択してください。

  • すべてのイベント
  • エラー発生時

https://docs.aws.amazon.com/chatbot/latest/adminguide/cloudwatch-logs.html

やってみた

Chat Applications コンソールから設定するクライアントを選択

AmazonQ Chatbot Enable Event Log 1

設定するチャンネルを選択して「編集」をクリック

AmazonQ Chatbot Enable Event Log 2

「設定の詳細」セクションのログ記録を設定し、「保存」をクリック

AmazonQ Chatbot Enable Event Log 3

ログ記録が正常に更新されたことを確認します。

AmazonQ Chatbot Enable Event Log 4

動作テスト

「すべてのイベント」を選択した場合は、「テストメッセージを送信」から動作テストができます。

※2025年5月時点の挙動として「エラーのみ」ではテストメッセージのログは出力されません。

AmazonQ Chatbot Enable Event Log 6

ログは次のロググループに出力されます。
なお、米国東部 (バージニア北部) リージョンに出力されます。

/aws/chatbot/【チャンネル名】

# 例
/aws/chatbot/hato-chatbot-Slack-Config

正常時のログサンプル

Received event from SNS Topic: arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack with message body: {
    "subscribeUrl": null,
    "type": "Notification",
    "signatureVersion": "1",
    "signature": "hato-signature",
    "topicArn": "arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack",
    "signingCertUrl": "https://sns.ap-northeast-1.amazonaws.com/SimpleNotificationService.pem",
    "messageId": "117e8720-d5e7-55c1-9731-e78422cda7d8",
    "message": {
        "source": "chatbot",
        "notificationType": "ChatbotSystemTest",
        "notificationSource": "sns",
        "configurationName": "hato-chatbot-Slack-Config",
        "workspaceId": "ABCDEFG"
    },
    "subject": null,
    "unsubscribeUrl": "https://sns.ap-northeast-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack:***REDACTED***",
    "timestamp": "2025-05-23T01:01:01.011Z",
    "token": null
}
Sending message to Slack (Workspace: ABCDEFG, Channel: notify-hato-amazon-q-developer) with title: :information_source: Amazon Q Developer in chat applications Notification | Test Message | Account: 123456789012

エラー時のログサンプル

Received event from SNS Topic: arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack with message body: {
    "subscribeUrl": null,
    "type": "Notification",
    "signatureVersion": "1",
    "signature": "hato-signature",
    "topicArn": "arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack",
    "signingCertUrl": "https://sns.ap-northeast-1.amazonaws.com/SimpleNotificationService-9c6465fa7f48f5cacd23014631ec1136.pem",
    "messageId": "3d871d6b-3c13-546b-b266-7dcd1d6e9a45",
    "message": {
        "content": {
            "description": "hato Message"
        }
    },
    "subject": null,
    "unsubscribeUrl": "https://sns.ap-northeast-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack:***REDACTED***",
    "timestamp": "2025-05-23T01:01:01.011Z",
    "token": null
}
Event received is not supported (see https://docs.aws.amazon.com/chatbot/latest/adminguide/related-services.html ): {
    "subscribeUrl": null,
    "type": "Notification",
    "signatureVersion": "1",
    "signature": "hato-signature",
    "topicArn": "arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack",
    "signingCertUrl": "https://sns.ap-northeast-1.amazonaws.com/SimpleNotificationService-9c6465fa7f48f5cacd23014631ec1136.pem",
    "messageId": "3d871d6b-3c13-546b-b266-7dcd1d6e9a45",
    "message": {
        "content": {
            "description": "hato Message"
        }
    },
    "subject": null,
    "unsubscribeUrl": "https://sns.ap-northeast-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:ap-northeast-1:123456789012:hato-sns-chatbot-Slack:***REDACTED***",
    "timestamp": "2025-05-23T01:01:01.011Z",
    "token": null
}

参考資料

Share this article

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.