在 AMI Linux 2 上轮换自定义日志
我需要使用 Ruby 在 AMI Linux 2 上的 AWS Elastic Beanstalk 上轮换我的 Resque 日志。我的 Puma 和 Nginx 日志正常轮换。我在下面添加了以下配置,但日志没有轮换。
.ebextensions/03_publish-logs.config
files:
"/opt/elasticbeanstalk/tasks/publishlogs.d/resque.conf" :
mode: "000755"
owner: root
group: root
content: |
/var/log/resque/rotated/*
.ebextensions/04_rotate-logs.config
files:
"/etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.resque.conf" :
mode: "000755"
owner: root
group: root
content: |
/var/log/resque/* {
su root root
size 10M
rotate 5
missingok
compress
notifempty
copytruncate
dateext
dateformat %s
olddir /var/log/resque/rotated
}
I need to rotate my Resque logs on AWS Elastic Beanstalk on AMI Linux 2 with Ruby. My Puma and Nginx logs rotate properly. I've added the following config below, but the logs are not getting rotated.
.ebextensions/03_publish-logs.config
files:
"/opt/elasticbeanstalk/tasks/publishlogs.d/resque.conf" :
mode: "000755"
owner: root
group: root
content: |
/var/log/resque/rotated/*
.ebextensions/04_rotate-logs.config
files:
"/etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.resque.conf" :
mode: "000755"
owner: root
group: root
content: |
/var/log/resque/* {
su root root
size 10M
rotate 5
missingok
compress
notifempty
copytruncate
dateext
dateformat %s
olddir /var/log/resque/rotated
}
I'm following this documentation: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html#health-logs-logrotate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您忘记将此配置添加到 logrotate 中。
将此代码添加到 .ebextensions:
You forgot to add this config to logrotate.
Add this code to .ebextensions: