PHP - AWS CloudWatch Logs return tooNewLogEventsStartIndex


PHP - AWS CloudWatch Logs return tooNewLogEventsStartIndex

我正在使用AWS PHP SDK,以允许客户端应用程序将一批日志事件发送到我的中央日志@AWS CloudWatch Logs。

使用 PutLogEvents(( 方法,我将一批日志推送到 AWS,并收到以下响应,其中tooNewLogEventStartIndex为拒绝原因。

object(Guzzle'Service'Resource'Model)#192 (2) {
  ["structure":protected]=>
  NULL
  ["data":protected]=>
  array(2) {
    ["nextSequenceToken"]=>
    string(56) "49557048644494214342955772042233869869420536807120962306"
    ["rejectedLogEventsInfo"]=>
    array(1) {
      ["tooNewLogEventStartIndex"]=>
      int(0)
    }
  }
}

我找不到任何文档@AWS解释此错误的含义。有人知道吗?

显然,此错误意味着日志事件上的时间戳是遥远的未来。我在代码中犯了一个错误,并将我的时间戳乘以 1000(到微秒(,这太多了,使时间戳有效。