Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
How to do logging in MEAN Stack

which is the best way to enable logging in node , express , mongoose application? I have been using console logging ;but there is no way to turn it on or off during production. is there something as solid as log4j and can be used in production applications

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can use winston.js, https://github.com/winstonjs/winston#logging-levels You can use log levels and specify which level to log in console and which into some logfile

  var logger = new (winston.Logger)({
transports: [
  new (winston.transports.Console)({ level: 'error' }),
  new (winston.transports.File)({
    filename: 'somefile.log',
    level: 'info'
  })
]

});

But there is also log4js https://github.com/nomiddlename/log4js-node

about 4 years ago · Santiago Trujillo Report

0

You can install morgan, Use npm install morgan,

After installing it,require it i.e var morgan = require('morgan'); Since you have express installed, You can then do this to enable morgan, app.use(morgan('dev'));

This should work.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!