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

252
Views
How do I disable express logs in my node.js CLI?

I am new to node.js and I am trying to move away from using console.log for debugging everything. I am trying to use

debug("test message")

instead of console.log for everything.

I installed the debug npm package, and it instructed me to:

set DEBUG=* node server.js

But, with my express package, I get the following: code picture

The app message in blue is the only relevant message to me since I am trying to use that instead of console.log. How can I get rid of these express logs? Do you think at some point they would be important?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

you can use it like

dbg=debug('myserver:app')

and output messages with

dbg('A new message')

also to output only those messages that you want

set DEBUG=myserver:app node server.js

you can also exclude with - or include like myserver:app,express:*

with DEBUG environmental variable you can specify what to output or no. more information https://www.npmjs.com/package/debug check the wildcards and examples

about 4 years ago · Santiago Trujillo Report

0

The correct command which worked for me is:

set DEBUG=*,-express:*  node server.js

this will enable all messages, then exclude everything starting with express:

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!