如何从 AWS CloudWatch 中排除访问日志?
当我启用从 AWS Elastic Beanstalk 到 CloudWatch 的日志流式传输时,我不希望流式传输 nginx/access.log,只流式传输 log/web.stdout.log
这可能吗?
我在“身份和访问管理 (IAM)”中创建了一个策略:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "logs:CreateLogStream",
"Resource": "arn:aws:logs:*:326272929619:log-group:/aws/elasticbeanstalk/Myweather-env/var/log/web.stdout.log:log-stream:*"
}
]
}
但是当我转到 Elastic Beanstalk 并启用“实例日志流式传输到 CloudWatch Logs”时,它会创建以下日志组:
/aws/elasticbeanstalk/Myweather-env/environment-health.log
/aws/elasticbeanstalk/Myweather-env/var/log/eb-engine.log
/aws/elasticbeanstalk/Myweather-env/var/log/eb-hooks.log
/aws/elasticbeanstalk/Myweather-env/var/log/nginx/access.log <= can that be excluded?
/aws/elasticbeanstalk/Myweather-env/var/log/nginx/error.log <= same
/aws/elasticbeanstalk/Myweather-env/var/log/web.stdout.log
我正在运行一个 Spring Boot 应用程序,该应用程序包含 ebextensions 中的配置:
option_settings:
- namespace: aws:elasticbeanstalk:cloudwatch:logs
option_name: StreamLogs
value: true
任何帮助将不胜感激。
When I enable log streaming from AWS Elastic Beanstalk to CloudWatch I don't want the nginx/access.log to be streamed, only log/web.stdout.log
Is that possible?
I have created a policy in "Identity and Access Management (IAM)" :
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "logs:CreateLogStream",
"Resource": "arn:aws:logs:*:326272929619:log-group:/aws/elasticbeanstalk/Myweather-env/var/log/web.stdout.log:log-stream:*"
}
]
}
But when I go to Elastic Beanstalk and enable "Instance log streaming to CloudWatch Logs", it creates the following log groups:
/aws/elasticbeanstalk/Myweather-env/environment-health.log
/aws/elasticbeanstalk/Myweather-env/var/log/eb-engine.log
/aws/elasticbeanstalk/Myweather-env/var/log/eb-hooks.log
/aws/elasticbeanstalk/Myweather-env/var/log/nginx/access.log <= can that be excluded?
/aws/elasticbeanstalk/Myweather-env/var/log/nginx/error.log <= same
/aws/elasticbeanstalk/Myweather-env/var/log/web.stdout.log
I'm running a Spring Boot application that contains a configuration in ebextensions:
option_settings:
- namespace: aws:elasticbeanstalk:cloudwatch:logs
option_name: StreamLogs
value: true
Any help will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论