【问题标题】:CloudWatch logs with Amazon Linux 2使用 Amazon Linux 2 的 CloudWatch 日志
【发布时间】:2020-07-12 19:35:32
【问题描述】:

我正在升级我的 Elastic Beanstalk 环境以使用 Amazon Linux 2。

在我的旧环境中,我可以通过使用 cw.exe /aws/elasticbeanstalk/myapp/var/log/eb-docker/containers/eb-current-app/stdouterr 查看日志组来监控我的 Spring Boot 应用程序日志。日志

但是,现在没有显示新应用程序的日志,而且我注意到 /eb-current-app/ 中的 stdouterr.log 似乎预先添加了日志的实例 ID。

我需要做什么来恢复以前的行为,以便可以监控我的日志?

【问题讨论】:

标签: amazon-web-services


【解决方案1】:

Cloudwatch 日志现在在 Amazon Linux 2 中以 yum 包的形式提供: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html

sudo yum install -y awslogs

您可能还需要编辑此文件/etc/awslogs/awscli.conf 才能更改区域。

最后你需要启动并启用

sudo systemctl start awslogsd
sudo systemctl enable awslogsd.service

并在此文件ebextensions/cloudwatch.config 中将其全部设置为config

【讨论】:

    猜你喜欢
    • 2017-05-27
    • 2018-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-24
    • 2022-11-25
    相关资源
    最近更新 更多