Open mohitzim opened 5 years ago
express-winston has a "logger" and "errorLogger" middleware. the "logger" middleware must be "use"ed before any other routes are added. The errorLogger should be added after all the routes are.
The "logger" is what logs non-error responses (i.e. 200).
I would need to see your express-winston/winston config and how you're using the libraries to know what your issue is.
Hi Can we log requests for each static resources which are being called ?
Logger does not log if file is found (200), but it logs when file not found (404). For example, if request is valid like http://domain/css/existingfile.css, Logger doesnot log. However, if request is invalid like http://domain/css/non-existingfile.css, Logger logs with proper 404 status code.
I need log when file is also found (200). How can be expressWinston configured that it logs for all the requests with whatever status code returned by server ?
Regards