-
Apply trimming to serializers (#143)
Previously, built-in serializers and custom ones supplied via the
serializers
option were not subject to trimming. This caused some emitted error logs to be extremely large.Now, trimming is applied across all serializers by default. If you rely on deeply nested
err
properties to troubleshoot your application, tune themaxObjectDepth
configured on your logger.
-
createDestination: Use
Record
type forstdoutMock.calls
andstdoutMock.onlyCall()
(#137)This allows you to destructure a call in your test code without the TypeScript compiler complaining:
const { level, ...rest } = stdoutMock.onlyCall();
-
createDestination: Implement logging integration testing (#134)
@seek/logger
now bundles a convenient mechanism for recording logging calls, built on Pino's support for customisable destinations. See docs/testing.md for more information.
- deps: pino-std-serializers ^7.0.0 (#130)
-
deps: pino 9 (#128)
Our minimum Node.js version is now 18.18.
-
Add default redact paths (#123)
@seek/logger
now redacts a set of built-in paths by default.These default paths cannot be disabled, and are concatenated to custom redact paths provided via
redact: ['custom.path']
orredact: { paths: ['custom.path'] }
.
-
deps: fast-redact ^3.5.0 (#119)
The mutation proof of concept that led us to pin v3.3.0 has been fixed in [email protected]:
const logger = createLogger({ redact: { censor: '???', paths: ['props.*'] }, }); const props = { name: 'PII' }; logger.child({ props }); logger.child({ props }); console.log({ props }); // { props: { name: 'PII' } }
The
TypeError
proof of concept reported in #14 has been fixed in [email protected].
-
deps: Pin
[email protected]
(#114)This aims to discourage adoption of
[email protected]
as it mutates input data when you:- Write application logs with
@seek/logger
orpino
- Configure the
redact
option with wildcards - Use the logger in a slightly strange way, such as calling
.child()
with the same props more than once
const logger = createLogger({ redact: { censor: '???', paths: ['props.*'] }, }); const props = { name: 'PII' }; logger.child({ props }); logger.child({ props }); console.log({ props }); // { props: { name: '???' } }
If you suspect that your project meets these criteria, consider reviewing your lock file to ensure that
[email protected]
is not installed before merging this upgrade or a subsequent lock file maintenance PR. - Write application logs with
-
Omit request headers (#92)
@seek/logger
now omits the following properties fromheaders
andreq.headers
by default:x-envoy-attempt-count
x-envoy-decorator-operation
x-envoy-expected-rq-timeout-ms
x-envoy-external-address
x-envoy-internal
x-envoy-peer-metadata
x-envoy-peer-metadata-id
x-envoy-upstream-service-time
To opt out of this behaviour, provide an empty list or your own list of omissible request headers to
omitHeaderNames
:const logger = createLogger({ name: 'my-app', + omitHeaderNames: ['dnt', 'sec-fetch-dest'], });
You can also extend the default list like so:
- 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'] });