Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
Express.js debugging info missing timing

I have an application running inside a docker container, using express.js 4.17.1.

I am trying to debug some performance issues and have enabled the Express debugging using the DEBUG=express:* env setting, this is working and giving me output as below:

Fri, 20 May 2022 13:24:09 GMT express:router use '/sitemap.txt' router
Fri, 20 May 2022 13:24:09 GMT express:router:layer new '/sitemap.txt'
Fri, 20 May 2022 13:24:09 GMT express:router use '/health' <anonymous>
...
Fri, 20 May 2022 13:24:09 GMT express:router use '/' <anonymous>
Fri, 20 May 2022 13:24:09 GMT express:router:layer new '/'
Fri, 20 May 2022 13:24:09 GMT express:application set "port" to 3000
...
Fri, 20 May 2022 13:25:17 GMT express:router dispatching GET /
Fri, 20 May 2022 13:25:17 GMT express:router query  : /
Fri, 20 May 2022 13:25:17 GMT express:router expressInit  : /
Fri, 20 May 2022 13:25:17 GMT express:router <anonymous>  : /
Fri, 20 May 2022 13:25:17 GMT express:router corsMiddleware  : /
...
Fri, 20 May 2022 13:25:17 GMT express:router router  : /
Fri, 20 May 2022 13:25:17 GMT express:router dispatching GET /
Fri, 20 May 2022 13:25:19 GMT express:view require "pug"
Fri, 20 May 2022 13:25:19 GMT express:view lookup "user/views/index.pug"
Fri, 20 May 2022 13:25:19 GMT express:view stat "/usr/app/pug/user/views/index.pug"
Fri, 20 May 2022 13:25:19 GMT express:view render "/usr/app/pug/user/views/index.pug"

However in all the examples, the output includes the critical timing information:

  express:router:route new / +0ms
  express:router:layer new / +1ms
  express:router:route get / +1ms
  express:router:layer new / +0ms
  express:router:route new / +1ms
  express:router:layer new / +0ms
  express:router:route get / +0ms
  express:router:layer new / +0ms
  express:application compile etag weak +1ms

How can I enable this timing information on the debug output?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This appears to be related to the different behaviour of the debug module in TTY vs non-TTY environments.

In a Docker container, colours are disabled by default, and with that the timing information appears to be omitted.

Try running the container with the additional env var DEBUG_COLORS=1.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda