I'm currently working on an application based on Node/Express.js.
I have a lot of different resources files (images, css, js...) that I don't want to be logged when executing my application...
Exemple: my node application logs:
GET /stylesheets/bootstrap.min.css 200 0ms GET /js/lib/jquery-1.8.2.min.js 200 0ms GET /stylesheets/bootstrap-responsive.2.1.1.min.css 200 0ms GET /stylesheets/font-awesome.css 200 0ms GET /stylesheets/bootstrapSwitch.css 200 0ms GET /js/lib/jquery-ui-1.8.23.effects.min.js 200 0ms GET /js/lib/knockout-2.1.0.js 200 0ms GET /js/src/messages.manage.js 200 0ms GET /js/lib/bootstrap.2.1.1.min.js 200 0ms GET /js/lib/bootstrapSwitch.js 200 0ms ...
My question is:
Can I remove these logs based on the extension of a file ? Example: *.js , *.css etc...
Move the logging pluggin below the resource pluggin in the app initialization. Done.
Woohoo for Connect!
On express.js 4,
comment: //app.use(morgan('dev'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With