@seek/logger
Advanced tools
Comparing version 6.2.0 to 6.2.1
{ | ||
"name": "@seek/logger", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"private": false, | ||
@@ -40,2 +40,3 @@ "description": "Standardized logging", | ||
"dtrim": "^1.11.0", | ||
"fast-redact": "3.3.0", | ||
"pino": "^8.0.0", | ||
@@ -45,6 +46,6 @@ "pino-std-serializers": "^6.2.0" | ||
"devDependencies": { | ||
"@changesets/cli": "2.26.2", | ||
"@changesets/get-github-info": "0.5.2", | ||
"@types/split2": "4.2.1", | ||
"skuba": "7.2.0", | ||
"@changesets/cli": "2.27.1", | ||
"@changesets/get-github-info": "0.6.0", | ||
"@types/split2": "4.2.3", | ||
"skuba": "7.5.0", | ||
"split2": "4.2.0" | ||
@@ -57,3 +58,4 @@ }, | ||
"publishConfig": { | ||
"access": "public" | ||
"access": "public", | ||
"provenance": true | ||
}, | ||
@@ -64,4 +66,4 @@ "skuba": { | ||
"type": "package", | ||
"version": "6.0.2" | ||
"version": "7.5.0" | ||
} | ||
} |
@@ -22,2 +22,3 @@ # @seek/logger | ||
- [Redaction](#redaction) | ||
- [Omitting Headers] | ||
- [Trimming](#trimming) | ||
@@ -62,5 +63,3 @@ - [Pino customisation](#pino-customisation) | ||
The request object is trimmed to a set of essential fields. | ||
Certain headers are omitted by default (e.g. `x-envoy-peer-metadata`). | ||
To opt out of this behavior, set the `omitHeaderNames` logger option to an empty list `[]` | ||
or provide your own list. | ||
Certain headers are omitted by default; see [Omitting Headers] for details. | ||
@@ -73,5 +72,3 @@ - `res` for HTTP responses. | ||
Certain headers are omitted by default (e.g. `x-envoy-peer-metadata`). | ||
To opt out of this behavior, set the `omitHeaderNames` logger option to an empty list `[]` | ||
or provide your own list. | ||
Certain headers are omitted by default; see [Omitting Headers] for details. | ||
@@ -115,2 +112,40 @@ All other fields will be logged directly. | ||
Additional property paths can be redacted using the `redact` logger option as per | ||
[pino redaction]. | ||
Note that `pino` only supports either redaction or removal of the properties, not | ||
redaction of some properties and removal of other properties. | ||
If you would like to redact some properties and remove others, you are recommended to | ||
configure `redact` with the list of paths to redact and provide a custom serializer to | ||
omit specific properties from the logged object. | ||
Custom serializers can be provided with the `serializers` logger option as described in | ||
[pino serializers] and is the strategy used for omitting default headers. | ||
### Omitting Headers | ||
Specific headers defined in `DEFAULT_OMIT_HEADER_NAMES` are omitted from the following properties: | ||
- `headers` | ||
- `req.headers` | ||
This behaviour can be configured with the `omitHeaderNames` option. | ||
- Opt out by providing an empty list. | ||
- Only omit specific headers by providing your own list. | ||
- Extend the defaults by spreading the `DEFAULT_OMIT_HEADER_NAMES` list and appending your own list. | ||
Example of extending the default header list: | ||
```diff | ||
-import createLogger from '@seek/logger'; | ||
+import createLogger, { DEFAULT_OMIT_HEADER_NAMES } from '@seek/logger'; | ||
const logger = createLogger({ | ||
name: 'my-app', | ||
+ omitHeaderNames: [...DEFAULT_OMIT_HEADER_NAMES, 'dnt' , 'sec-fetch-dest'] | ||
}); | ||
``` | ||
### Trimming | ||
@@ -174,4 +209,7 @@ | ||
[error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | ||
[Omitting Headers]: #omitting-headers | ||
[pino]: https://github.com/pinojs/pino | ||
[pino options]: https://github.com/pinojs/pino/blob/master/docs/api.md#options | ||
[pino-pretty]: https://github.com/pinojs/pino-pretty | ||
[pino redaction]: https://github.com/pinojs/pino/blob/master/docs/redaction.md | ||
[pino serializers]: https://github.com/pinojs/pino/blob/master/docs/api.md#serializers-object |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37096
211
4
+ Addedfast-redact@3.3.0
+ Addedfast-redact@3.3.0(transitive)
- Removedfast-redact@3.5.0(transitive)