当我通过Web界面或“ eb日志”请求用于弹性beantalk环境的日志文件时,我会获得日志文件/var/log/eb-version-deployment.log、/opt/python/log/httpd的内容.out,/ var / log / cfn-hup.log等。
是否可以将其他日志(例如test_output.log)添加到Web界面收集的日志和“ eb日志”中?
最佳答案
Elastic Beanstalk在此文件夹中查找配置文件,这些配置文件涉及要拖尾的日志:
/opt/elasticbeanstalk/tasks/taillogs.d/
我的盒子上有一些文件
[ec2-user@ip taillogs.d]$ ls -al
total 32
drwxr-xr-x 2 root root 4096 Sep 27 05:49 .
drwxr-xr-x 6 root root 4096 Sep 27 05:49 ..
-rw-r--r-- 1 root root 58 Sep 27 05:49 eb-activity.conf
-rw-r--r-- 1 root root 35 Sep 27 05:49 eb-version-deployment.conf
-rw-r--r-- 1 root root 16 Oct 15 03:44 httpd.conf
-rw-r--r-- 1 root root 16 Oct 15 03:44 nginx.conf
-rw-r--r-- 1 root root 26 Oct 15 03:44 nodejs.conf
-rw-r--r-- 1 root root 29 Oct 15 03:44 npm.conf
每个人都有一行,就像这样:
/var/log/nodejs/nodejs.log
要么
/var/log/nginx/*
使用
.ebextensions
添加配置文件以尾随自己的日志:files:
"/opt/elasticbeanstalk/tasks/taillogs.d/my-app-logs.conf":
mode: "000755"
owner: root
group: root
content: |
/var/log/my-app.log
更多信息在这里:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html#health-logs-extend
关于logging - 是否可以将自定义日志文件添加到由Elastic beantalk的“eb logs”命令捕获的日志中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25755695/