4

I have successfully deployed a Node.js application to AWS Elastic Beanstalk. This application is not a web app, so there is no web page or web server to interact with. It runs continuously in a loop and provide feedback through standard "console.log" calls (to stdout).

How can I easily monitor my running application? Heroku has the "heroku logs" command, which is exactly the kind of tool I need. I tried the "eb logs" command, but the output is not what I am looking for (no stdout).

extrabacon
  • 1,220
  • 1
  • 12
  • 14

2 Answers2

9

I discovered that a Node.js EB app logs its output into /var/log/nodejs/nodejs.log. When extracting logs, through the web console or the "eb logs" command, look out for this log file.

extrabacon
  • 1,220
  • 1
  • 12
  • 14
0

Probably not exactly what you were looking for, but we use a log server (LogStash, Kibana and ElasticSearch) to gather, index and visualize our logs. The problem with the console output is, imo, that you have no guarantee if the server is running or not. Instances may spawn and terminate theoretically randomly (well, under load). So you'll lose your logs constantly.

A log collector will take the logs from a file (or you can write them to a UDP port, if you wish) and store them on a separate environment for analysis and possibly visualization.

marco
  • 685
  • 4
  • 18