feat(logger): add explicit Sentry event channel
This commit is contained in:
@@ -22,7 +22,7 @@ Containers can use `MIFI_LOG_LEVEL` and `MIFI_LOG_NAMESPACES`. Explicit `level`
|
||||
|
||||
## Sentry
|
||||
|
||||
The Sentry adapter has no SDK dependency. Provide the SDK that your application already uses. In a production browser, errors go to Sentry without also appearing in the console. In Node, they go to both Sentry and stderr.
|
||||
The Sentry adapter has no SDK dependency. Provide the SDK that your application already uses. In a production browser, errors go to Sentry without also appearing in the console. In Node, they go to both Sentry and stderr. Use `logger.sentry` to explicitly capture selected non-error events without changing the default policy or writing them to the console when they are otherwise suppressed.
|
||||
|
||||
```ts
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
@@ -30,6 +30,8 @@ import { createLogger } from "@mifi/logger";
|
||||
import { createSentrySink } from "@mifi/logger/sentry";
|
||||
|
||||
const logger = createLogger({ environment: "production", sentry: createSentrySink(Sentry) });
|
||||
|
||||
logger.sentry.info("Cache warmed", { entries: 42 });
|
||||
```
|
||||
|
||||
## Releases
|
||||
|
||||
Reference in New Issue
Block a user