Error logging in Node.js

Overview

The following describes how to specify a custom output and error log location when launching your Node.js app.

Specifying 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

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?