Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export default defineConfig([
quoteProps: 'as-needed',
}),
{
settings: {
'import-x/resolver': {
// Resolve workspace packages to their sources, so no build is needed for linting
typescript: { conditionNames: ['@brainbits/source', 'types', 'import', 'node', 'default'] },
},
},
languageOptions: {
parserOptions: {
projectService: {
Expand Down
56 changes: 16 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"eslint-plugin-import-x": "^4.17.1",
"typescript": "~6.0.3",
"typescript-eslint": "^8.71.2",
"vite": "^8.3.4",
"vitest": "^5.0.4"
}
}
30 changes: 30 additions & 0 deletions packages/node-logger-plugin-sentry/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# `node-logger-plugin-sentry`

Sends log events to [Sentry](https://sentry.io): events up to the `exceptionLevel` as exceptions, all other events as
breadcrumbs of the next exception.

```json
"nodeLogger": {
"plugins": [
"@brainbits/node-logger-plugin-sentry"
],
"sentry": {
"dsn": "env(SENTRY_DSN)"
}
}
```

## Options

| Option | Default | Description |
|----------------------|----------------|---------------------------------------------------------------------|
| `dsn` | `''` | Sentry DSN, Sentry is disabled without it |
| `environment` | `'dev'` | Sentry environment |
| `release` | `null` | Sentry release |
| `debug` | `false` | Enables the debug mode of the Sentry SDK |
| `exceptionLevel` | `'error'` | Events up to this level are sent as exceptions |
| `maxBreadcrumbs` | `50` | Maximum number of breadcrumbs sent with an exception |
| `breadcrumbLevelMap` | all levels | Maps log levels to Sentry breadcrumb levels, unmapped levels are skipped |
| `tags` | `{}` | Tags added to every exception |

The options are validated together with the logger configuration. Booleans and numbers may be strings, so they can be
set with `env()`.
3 changes: 2 additions & 1 deletion packages/node-logger-plugin-sentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"author": "Brainbits <moriarty@brainbits.net>",
"license": "MIT",
"dependencies": {
"@sentry/node": "^11.7.0"
"@sentry/node": "^11.7.0",
"zod": "^4.6.7"
},
"peerDependencies": {
"@brainbits/node-logger": "^2.2.3"
Expand Down
Loading
Loading