doujie9882 2018-02-28 13:35
浏览 174

适用于SMS的Amazon AWS SNS交付状态具有随机日志流

I am using Amazon's php sdk.

I use Amazon SNS service to send direct sms. When I send an sms from my php application it gives me a message ID.

I have to track the delivery status of each of my message. I have enabled cloud watch logs for Text Messaging using Manage text messaging preferences settings. The IAM role is properly configured and logs end in Cloudwatch.

Now the problem I am facing is that the system creates a random log stream for every message i send.

Here is a screen shot.

enter image description here

I have sent six messages and all of them has been successful( I am sending them to myself). And against every message a single log stream exists.

API gives me a function to get logs based upon LogGroupName and LogGroupStream. The LogGroupName remains the same but LogGroupStream is differnt for every message.

here is the sdk call

$result = $client->getLogEvents([
    'endTime' => <integer>,
    'limit' => <integer>,
    'logGroupName' => '<string>', // REQUIRED
    'logStreamName' => '<string>', // REQUIRED
    'nextToken' => '<string>',
    'startFromHead' => true || false,
    'startTime' => <integer>,
]);

How should i get the Logs? Is there a way to tell amazon to log all of sms deliveries to a single LOG STREAM. So i know the stream and can query for logs.

  • 写回答

1条回答 默认 最新

  • duanji9378 2018-11-13 18:34
    关注

    You could use filterLogEventsMethod from CloudWatchLogsClient:

    $result = $client->filterLogEvents(array(    
    'logGroupName' => 'string', //Required
    'startTime' => integer,
    'endTime' => integer,
    'filterPattern' => 'string',
    'nextToken' => 'string',
    'limit' => integer,
    'interleaved' => true || false));
    

    Reference: Aws Docs

    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数