Skip to content

Commit 3d2a945

Browse files
committed
Remove default rewrite-appender.
1 parent f9f28dd commit 3d2a945

File tree

2 files changed

+2
-59
lines changed

2 files changed

+2
-59
lines changed

src/core/server/logging/logging_config.test.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,13 @@ test('`getLoggerContext()` returns correct joined context name.', () => {
4848
test('correctly fills in default config.', () => {
4949
const configValue = new LoggingConfig(config.schema.validate({}));
5050

51-
expect(configValue.appenders.size).toBe(3);
51+
expect(configValue.appenders.size).toBe(2);
5252

5353
expect(configValue.appenders.get('default')).toEqual({
5454
type: 'console',
5555
layout: { type: 'pattern', highlight: true },
5656
});
5757
expect(configValue.appenders.get('console')).toEqual({
58-
type: 'rewrite',
59-
appenders: ['rewrite-console'],
60-
policy: {
61-
type: 'meta',
62-
mode: 'update',
63-
properties: [
64-
{
65-
path: 'http.request.headers.authorization',
66-
value: '[REDACTED]',
67-
},
68-
{
69-
path: 'http.request.headers.cookie',
70-
value: '[REDACTED]',
71-
},
72-
{
73-
path: 'http.response.headers.set-cookie',
74-
value: '[REDACTED]',
75-
},
76-
],
77-
},
78-
});
79-
expect(configValue.appenders.get('rewrite-console')).toEqual({
8058
type: 'console',
8159
layout: { type: 'pattern', highlight: true },
8260
});
@@ -94,7 +72,7 @@ test('correctly fills in custom `appenders` config.', () => {
9472
})
9573
);
9674

97-
expect(configValue.appenders.size).toBe(3);
75+
expect(configValue.appenders.size).toBe(2);
9876

9977
expect(configValue.appenders.get('default')).toEqual({
10078
type: 'console',
@@ -211,7 +189,6 @@ describe('extend', () => {
211189
expect([...mergedConfigValue.appenders.keys()]).toEqual([
212190
'default',
213191
'console',
214-
'rewrite-console',
215192
'file1',
216193
'file2',
217194
]);

src/core/server/logging/logging_config.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@ const ROOT_CONTEXT_NAME = 'root';
2828
*/
2929
const DEFAULT_APPENDER_NAME = 'default';
3030

31-
/**
32-
* Sensitive `LogMeta` paths that we want to censor by default.
33-
* These paths are only filtered in a default logging configuration.
34-
*/
35-
const SENSITIVE_META_PATHS = [
36-
'http.request.headers.authorization',
37-
'http.request.headers.cookie',
38-
'http.response.headers.set-cookie',
39-
] as const;
40-
41-
/**
42-
* Replacement text to use when censoring SENSITIVE_META_PATHS.
43-
*/
44-
const REDACTED_META_TEXT = '[REDACTED]';
45-
4631
const levelSchema = schema.oneOf(
4732
[
4833
schema.literal('all'),
@@ -168,26 +153,7 @@ export class LoggingConfig {
168153
} as AppenderConfigType,
169154
],
170155
[
171-
// By default, we transparently rewrite `LogMeta` sent to the
172-
// console appender to remove potentially sensitive keys.
173-
// This logic is also hardcoded in the http response logger
174-
// itself, but included here as an additional measure for
175-
// other loggers which might be logging the same data.
176156
'console',
177-
{
178-
type: 'rewrite',
179-
appenders: ['rewrite-console'],
180-
policy: {
181-
type: 'meta',
182-
mode: 'update',
183-
properties: SENSITIVE_META_PATHS.map((path) => ({ path, value: REDACTED_META_TEXT })),
184-
},
185-
} as AppenderConfigType,
186-
],
187-
[
188-
// This is our actual console appender which the rewrite appender
189-
// sends its records to.
190-
'rewrite-console',
191157
{
192158
type: 'console',
193159
layout: { type: 'pattern', highlight: true },

0 commit comments

Comments
 (0)