作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 AWS Elastic Beanstalk 中部署了一个 PHP Laravel Worker,并希望流式传输 /var/app/current/storage/logs/*.log
至 云观察 .然而,我遇到的解决方案要么是针对 锻造 部署或 Vanilla EC2 实例。
将不胜感激在这件事上的任何帮助。
最佳答案
您需要按照 here 的说明配置 CloudWatch 代理:
option_settings:
- namespace: aws:elasticbeanstalk:cloudwatch:logs
option_name: StreamLogs
value: true
- namespace: aws:elasticbeanstalk:cloudwatch:logs
option_name: DeleteOnTerminate
value: false
- namespace: aws:elasticbeanstalk:cloudwatch:logs
option_name: RetentionInDays
value: 7
packages:
yum:
awslogs: []
files:
"/etc/awslogs/awscli.conf" :
mode: "000600"
owner: root
group: root
content: |
[plugins]
cwlogs = cwlogs
[default]
region = `{"Ref":"AWS::Region"}`
"/etc/awslogs/awslogs.conf" :
mode: "000600"
owner: root
group: root
content: |
[general]
state_file = /var/lib/awslogs/agent-state
"/etc/awslogs/config/logs.conf" :
mode: "000600"
owner: root
group: root
content: |
[/var/app/current/storage/logs]
log_group_name = `{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Ref":"AWSEBEnvironmentName" }, "var/app/current/storage/logs"]]}`
log_stream_name = {instance_id}
file = /var/app/current/storage/logs/*.log
commands:
"01":
command: chkconfig awslogs on
"02":
command: service awslogs restart
关于amazon-web-services - 如何在 AWS Elastic Beanstalk 中部署 CloudWatch Laravel 日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43425401/
我是一名优秀的程序员,十分优秀!