aleios-cloud / aleios-cloud/sls-dev-tools

help request: not seeing any data in the "Server log"

未关闭
#415 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
871
派生
45
PR 合并指标
30 天内没有已合并 PR

描述

Howdy,
This tool looks great! I'm just trying it out for the first time - sorry for the noob questions. I'm struggling to get cloudwatch logs to feed into `Server Log`. I've tried setting the `--start-time` but no dice. I can list the lambda, invoke it from sls-dev-tools (and see the result in `Dashboard Logs`), and see stats - but the data is not feeding through.

How can I debug it?

## What I've tried

- fiddling with start time
- `sls-dev-tools -r eu-west-2 -n sls-dev-tools-test-prod -t '10 September 2020 00:00 GMT'`
- deploying to different regions (none working): eu-west-2, us-west-1, af-south-1
- confirmed that cloudwatch logs are present = check
```sh
CWLOG=/aws/lambda/sls-dev-tools-test-prod-hello && aws logs describe-log-streams --log-group-name $CWLOG | jq -r .logStreams[].logStreamName | tr '\n' '\0' | xargs -0 -n1 aws logs get-log-events --log-group-name $CWLOG --log-stream-name | jq -j ".events[].message"
# returns logs correctly
```
- multiple sls-dev-tools versions:
- tried latest 2: 1.1.10 & 1.1.8

## More info on my environment

- lambda
- deployed using serverless
- regions: eu-west-2, us-west-1, af-south-1
- os
- Ubuntu 18.04.5 LTS
- serverless
- `Framework Core: 2.0.0. Plugin: 4.0.2, SDK: 2.3.1, Components: 3.1.2`
- node = v14.1.0

## lambda source

serverless.yml

```yaml
service: sls-dev-tools-test

provider:
name: aws
runtime: nodejs12.x
region: eu-west-2
stage: prod

functions:
hello:
handler: hello.get
```

hello.js

```js
exports.get = function (event, context, callback) {
console.log(JSON.stringify({ event, context }, null, 2));
const response = {
statusCode: 200,
body: JSON.stringify({
event,
context,
message: "hi world",
}),
};
callback(null, response);
};
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。