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

149
Views
ejs.renderFile keeps logging output to stdout

I have a project using Express.JS with EJS as view engine. Whenever I run ejs.renderFile, either directly or with res.render, the generated function body gets logged to stdout.

It only happens when NODE_ENV is set to debug but the thing is that another team has a project with the same setup where it doesn't log anything even when they set NODE_ENV to debug.
I can't find anything different in their project that could account for this and they don't know either because they simply never had to do anything for it to not log.

I can prevent the logging when using res.renderFile by specifying the option debug: false, but I can't for the life of me figure out how to prevent it when using res.render.

Express.JS version: 4.15.2
EJS version: 2.5.6

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I can think of three ways how this can happen (instead of true, any truish value will do):

  • app.set('view options', { debug : true })
  • app.locals.debug = true
  • res.render('template', { debug : true })

The last two will trigger debug logging because AFAIK there is no distinction made between parameters-to-be-rendered and template-engine-options (at least not for EJS).

over 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!