Search code examples
node.jsloggingtailwinstonbunyan

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?


Solution

  • 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