Error logging in Node.js

Overview

You can specify a custom output and error log location when you launch your Node.js app.

How do I specify the output and error log location in Node.js?

Run the following command to specify the output and error log location.

Make sure to change example.js to your app name before running the command:

[server]$ node example.js > node_log.log 2> node_error.log

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?