Where is nodejs log file?

node.js

Solution

There is no log file. Each node.js "app" is a separate entity. By default it will log errors to STDERR and output to STDOUT. You can change that when you run it from your shell to log to a file instead.

node my_app.js > my_app_log.log 2> my_app_err.log

Alternatively (recommended), you can add logging inside your application either manually or with one of the many log libraries:

- winston

- log4js

- ...

Problem

I can't find a place where nodejs log file is stored. Because in my node server I have "Segmentation fault", I want to look at log file for additional info...

Original source