diff --git a/lib/winston/transports/http.js b/lib/winston/transports/http.js index 66a5df905..bc5ffd8d0 100644 --- a/lib/winston/transports/http.js +++ b/lib/winston/transports/http.js @@ -262,6 +262,6 @@ module.exports = class Http extends TransportStream { req.on('response', res => ( res.on('end', () => callback(null, res)).resume() )); - req.end(Buffer.from(jsonStringify(options), 'utf8')); + req.end(Buffer.from(jsonStringify(options, this.options.replacer), 'utf8')); } }; diff --git a/lib/winston/transports/index.d.ts b/lib/winston/transports/index.d.ts index acedfe415..b8b6c62b8 100644 --- a/lib/winston/transports/index.d.ts +++ b/lib/winston/transports/index.d.ts @@ -62,6 +62,7 @@ declare namespace winston { batch?: boolean; batchInterval?: number; batchCount?: number; + replacer?: (key: string, value: any) => any; } interface HttpTransportInstance extends Transport {