Note
Since @logtape/sentry package is now maintained along with the @logtape/logtape package, this repository is archived and no longer actively maintained.
Please refer to the LogTape repository for the latest updates and developments.
This package provides an Sentry sink for LogTape. It allows you to capture your LogTape logs and send them to Sentry.
The package is available on JSR and npm.
deno add jsr:@logtape/sentry # for Deno
npm add @logtape/sentry # for npm
pnpm add @logtape/sentry # for pnpm
yarn add @logtape/sentry # for Yarn
bun add @logtape/sentry # for BunThe quickest way to get started is to use the getSentrySink() function
without any arguments:
import { configure } from "@logtape/logtape";
import { getSentrySink } from "@logtape/sentry";
await configure({
sinks: {
sentry: getSentrySink(),
},
filters: {},
loggers: [
{ category: [], sinks: ["sentry"], lowestLevel: "trace" },
],
});If you want to explicitly configure the Sentry client, you can pass the
Client instance to the getSentrySink() function:
import { configure } from "@logtape/logtape";
import { init } from "@sentry/node";
const client = init({
dsn: process.env.SENTRY_DSN,
});
await configure({
sinks: {
sentry: getSentrySink(client),
},
filters: {},
loggers: [
{ category: [], sinks: ["sentry"], lowestLevel: "trace" },
],
});To be released.
-
The minimum supported version of LogTape is now 0.12.0, which introduces
"trace"log level support. -
Log records having
errorproperty will now be sent to Sentry as exceptions. [#1, #2 by Martin Becze]
Initial release. Released on November 26, 2024.
