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

308
Visualizações
Is there a way to show winston log files like we show it in bunyan CLI?

In Bunyan logger we can see the log files like this: tail -f sample.log | bunyan and show the logs colorful and show json objects pretty, but I couldn't find some thinkg like that solution in Winston logger, any body has idea about that?

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

0

I wrote a tiny npm package based on Bunyan CLI for pretty printing winston logs, you can use that in this way:

  • npm i -g winston-log-viewer
  • tail -f logFile.log | winston-log-viewer

Or

  • tail -f logFile.log | npx winston-log-viewer

https://github.com/mohammadranjbarz/winston-log-viewer

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

Similar to winston-log-viewer I had created munia-pretty-json and using it for many projects. You can visualize any json log at console.

npm install -g munia-pretty-json

Your json data (app-log.json)

{"time":"2021-06-09T02:50:22Z","level":"info","message":"Log for pretty JSON","module":"init","hostip":"192.168.0.138","pid":123}
{"time":"2021-06-09T03:27:43Z","level":"warn","message":"Here is warning message","module":"send-message","hostip":"192.168.0.138","pid":123}

Run the command:

munia-pretty-json app-log.json

Or tail the json file:

tail -f app-log.json | munia-pertty-json

Here is readable output on console:

enter image description here

You can format the output with the template. The default template is '{time} {level -c} {message}'

Using template:

munia-pretty-json -t '{module -c} - {level} - {message}' app-log.json

Output:

enter image description here

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