0

Is there a way to access the Meteor server logs on a production server? All I needs is something that records what I'd see as the server console output on my dev machine, in a log file on the server. I would have expected Meteor to log them somewhere by default but I can't find anything.

I'm running Meteor 1.6 on a Digital Ocean droplet, Ubuntu 16.04.3. Deployed with Phusion Passenger.

I've hunted around and there are a bunch of logging packages for Meteor but I can't figure how to use any of them; there don't seem to be any basic examples or instructions.

This must be a really common requirement - anybody know how to do this? Thanks!

Little Brain
  • 2,647
  • 1
  • 30
  • 54

1 Answers1

0

Remember that Meteor runs on Node.js. Therefore, many things valid for Node.js is also valid for Meteor like location of the default root folder of the built-in web server. You should check the path "/var/www/html", first for the server logs.

Gokhan Karadag
  • 574
  • 6
  • 17
  • Thanks, but there are no logs in "/var/www/html". There is only a file index.nginx-debian.html. – Little Brain Jan 06 '18 at 09:58
  • I haven't used Phusion Passenger. I am not sure if it changes the path, however, have you look at "/var/www" folder carefully? Another option would be performing linux search recursively at the top level folder "/". There is a stackoverflow track for searching "https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux" – Gokhan Karadag Jan 06 '18 at 10:38
  • There really are not any logs in "/var/www". I have looked at the Passenger log in /var/log/nginx/error.log, but it only tells me that an incomplete response was received from the application, which I think means my app crashed but I'm not sure without more information. – Little Brain Jan 06 '18 at 18:44
  • Ah! The console output from Meteor is in the Passenger log, it's just hard to find because it's in with all the Passenger stuff. Now I have a workaround: first look through the Passenger log to find any message from your app, this tells you the App number which precedes any message. Then in the terminal type: grep -i -e "app 12345" /var/log/nginx/error.log. Replace 12345 with whatever is your app's number from the log file. This will write your app's log entries to the console. I'd prefer to find a way to write the Meteor output to its own location. – Little Brain Jan 06 '18 at 19:44