jojo jojo - 12 days ago 4x
Node.js Question

does nodejs has server log?

Does nodejs have server log? I am running a expressjs app, i hook up logger within my app to get application level log. but what if the request never come into my app, is there any sever log i can collect?

i run my app in a docker container with command similar to below

node /path/to/app.js

Like php application, if i hosted app in a apache server or nginx, i will be able to config server for server log.

How can i do similar for my node app?


Node js doesn't work this way, each node application is a seperate entity. So if you're looking to find the log file, there isn't one, by default it logs to the console.

What you can do is this (when you run your app configure your log locations):

node app.js > your_app_name.log 2> your_app_error.log

Please see this question for more details:

Where is nodejs log file?