@seek/logger
Advanced tools
Changelog
9.0.0
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 the maxObjectDepth
configured on your logger.
Changelog
8.1.0
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.
Changelog
7.0.0
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']
or redact: { paths: ['custom.path'] }
.
Changelog
6.2.2
deps: fast-redact ^3.5.0 (#119)
The mutation proof of concept that led us to pin v3.3.0 has been fixed in fast-redact@3.4.1:
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 fast-redact@3.5.0.
Changelog
6.2.1
deps: Pin fast-redact@3.3.0
(#114)
This aims to discourage adoption of fast-redact@3.4.0
as it mutates input data when you:
@seek/logger
or pino
redact
option with wildcards.child()
with the same props more than onceconst 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 fast-redact@3.4.0
is not installed before merging this upgrade or a subsequent lock file maintenance PR.
Changelog
6.2.0
Omit request headers (#92)
@seek/logger
now omits the following properties from headers
and req.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']
});