简体   繁体   English

ElasticBeanstalk Amazon Linux 2 节点未登录到 web.stdout

[英]ElasticBeanstalk Amazon Linux 2 Node not logging to web.stdout

I've been upgrading to Amazon linux 2 recently and I'm now trying to debug my node application with the web.stdout logs.我最近一直在升级到 Amazon linux 2,现在我正在尝试使用 web.stdout 日志调试我的节点应用程序。 I was seeing them previously and now they aren't being shown.我以前看过它们,现在它们没有显示。 I can curl my node application as expected so I know it has to be running.我可以按预期卷曲我的节点应用程序,所以我知道它必须正在运行。

I've tried to restart my amazon-cloudwatch-agent since that is what is being used for logging and I've re-deployed my beanstalk application and it's still not showing them.我试图重新启动我的amazon-cloudwatch-agent因为这是用于日志记录的,我已经重新部署了我的 beanstalk 应用程序,但它仍然没有显示它们。 I'm not sure why this would be happening.我不确定为什么会发生这种情况。

Well... I'm using a Procfile to handle my npm run start:prod command and in the Procfile I was using I had a different process_name being used.嗯...我正在使用 Procfile 来处理我的npm run start:prod命令,并且在我使用的 Procfile 中,我使用了不同的 process_name。 The correct way I needed to start my node app to have it log to the web.stdout log was to have it setup like this...我需要启动我的节点应用程序以使其登录到 web.stdout 日志的正确方法是像这样设置它......

<process_name1>: <command1>
web: npm run start:prod

I didn't see anything that specifically stated to name the start command web: until reading the documentation here ,我没有看到任何特别说明命名启动命令web:直到阅读此处的文档,

"Elastic Beanstalk captures standard output and error streams from Procfile processes in log files. Elastic Beanstalk names the log files after the process and stores them in /var/log. For example, the web process in the preceding example generates logs named web-1.log and web-1.error.log for stdout and stderr, respectively." “Elastic Beanstalk 从日志文件中捕获 Procfile 进程的标准输出和错误流。Elastic Beanstalk 将日志文件命名为进程后,并将它们存储在 /var/log 中。例如,前面示例中的 Web 进程生成名为 web-1 的日志.log 和 web-1.error.log 分别用于 stdout 和 stderr。”

Once I changed my process_name1 to web , I started to see logs in the web.stdout log again.一旦我将process_name1更改为web ,我又开始在 web.stdout 日志中看到日志。

+1 for having a helpful co-worker ask why I didn't name it web +1 有一位乐于助人的同事问我为什么不将其命名为web

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM