Elastic Beanstalk 与 CloudWatch 日志和 Nginx

che*_*xis 5 nginx amazon-web-services amazon-cloudwatch amazon-elastic-beanstalk

我已在 EBS 应用程序中激活 CloudWatch 日志。我已启用附加截图:

在此处输入图片说明

但是当我查看 awslogs.log 时,我总是可以找到这个错误:

cwlogs.push.stream - WARNING - 3317 - Thread-1 - No file is found with given path '/var/log/httpd/error.log*'.
cwlogs.push.stream - WARNING - 3317 - Thread-1 - No file is found with given path '/var/log/httpd/access.log*'.
Run Code Online (Sandbox Code Playgroud)

我不知道为什么,因为 httpd 是来自 Apache 的服务,而且我正在使用 Nginx(以 Node.js 作为源)。

如何禁用/删除此错误?

谢谢。

Abh*_*ain 1

发生这种情况是因为awslogsEC2 实例上的应用程序正在查找这些文件以发送到 CloudWatch。

您可以检查和编辑位于以下位置的配置文件:

/etc/awslogs/awslogs.conf
Run Code Online (Sandbox Code Playgroud)

确保重新启动服务:

sudo service awslogs restart
Run Code Online (Sandbox Code Playgroud)

您可以在那里指定自己的文件并创建不同的组等等。

资源:

https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html