Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 2f367be

Browse files
authored
Merge pull request #33 from AckeeCZ/docs/28-readme-changelog
📝 Update readme and changelog
2 parents 26784ef + 865a51d commit 2f367be

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Added
44
- parent logger name inheritance
5-
- logging to sentry
5+
- logging to sentry (option `sentry` and `sentryLevel`)
66

77
### Changed
88
- `pino.pretty` replaced with `util.inspect`

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ When configured, cosmas (additionally to standard logging) captures all logs via
106106

107107
Either way, scope is appropriately set, as well as all payload is passed on in scope's metadata.
108108

109+
By default, Cosmas only logs to Sentry logs with `warn` or higher level. You can change this behaviour by setting `sentryLevel` option.
109110

110111

111112
## Express middleware
@@ -175,6 +176,8 @@ Options override both default logger configuration and environment-specific conf
175176
- `disableStackdriverFormat` - if set to `false`, logger will add `severity` field to all log objects, so that log levels in Google Stackdriver work as expected. Defaults to `false`
176177
- `skip` - Function to be used in express middlewares for filtering request and response logs. If the function returns `true` for a given request, no message will be logged. No default value.
177178
- `config` - object, which will be passed to underlying logger object. Right now, underlying logger is [pino](https://github.com/pinojs/pino), so for available options see [pino API docs](https://github.com/pinojs/pino/blob/master/docs/API.md#pinooptions-stream)
179+
- `sentry` - `true` to enable without configuring or `<sentry dsn>` to enable and configure with dsn beforehand, `false` to disable (default)
180+
- `sentryLevel` - set minimum level to log to sentry (default `warn`)
178181

179182
## Default serializers
180183
`cosmas` defines some [pino serializers](https://github.com/pinojs/pino/blob/master/docs/API.md#constructor) on its own

0 commit comments

Comments
 (0)