require
it or import
in your codebase:@logtail/js
which combines the node
and browser
packages:@logtail/koa
NPM package and then attach the Logtail instance as a middleware to your Koa instance:4xx
or 5xx
status code, and doesn't throw any uncaught errors while handling the requests. These are logged to Logtail using LogLevel.Info
β5xx
status code are considered errors and are logged with LogLevel.Error
β@logtail/node
logger, you can use the .log|info|warn|error
functions as normal to handle logging anywhere in your app.@logtail/winston
NPM package and set up the Logtail transport according to the following example:@logtail/bunyan
NPM package and set up the Logtail stream according to the following example:source-token
that you'll get after you create a Source in your logtail.com account. With the source token at hand, you can create a Logtail instance and start logging:Error
. The second argument is an optional object, which can contain a tree structure with string, numeric, boolean, and Date
values.debug
, info
, warn
, and error
. You can either log by calling the respective functions on the Logtail
object, or you can pass the level as an additional parameter to the generic log
function: