Install the @logtail/winston and @logtail/node npm packages:
Set up the Winston transport:
Use the Winston logger as usual:
You should see your logs in Better Stack → Live tail.
Please let us know at hello@betterstack.com.
We're happy to help! 🙏
Interested in learning more about using multiple Winston transports and Winston log levels? Check out our Complete Guide to Winston Logging in Node.js.
You may encounter TypeScript errors when including the transformer, which can be fixed by modifying the TypeScript config.
For a 'TransportStream' error:
Modify tsconfig.json with:
Thanks @Nightbr for submitting this!
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.