Install the @logtail/koa npm package:
Set up the Better Stack client and attach it to your Koa instance:
All HTTP requests handled by Koa will be logged and sent to Better Stack.
Ensure all logs are flushed to Better Stack:
You should see your logs in Better Stack → Live tail.
Please let us know at hello@betterstack.com.
We're happy to help! 🙏
Successful requests end with a 2xx or 3xx status codes and do not throw any errors. They are logged to Logtail using Info log level.
Requests with 4xx status codes are considered warnings. Such requests are logged to Logtail with Warn log level.
Requests with 5xx status codes are considered errors. Such requests are logged to Logtail with Error log level.
Unhandled errors are caught by Logtail middleware. The errors are logged to Logtail with Error log level.
With Logtail Koa client you can use debug(), info(), warn(), and error() methods just like with Logtail JavaScript client.
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.