简体   繁体   中英

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. 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. 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. 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...

<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 ,

"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."

Once I changed my process_name1 to web , I started to see logs in the web.stdout log again.

+1 for having a helpful co-worker ask why I didn't name it web

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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