feat(logging): export redactLogLine function
Signed-off-by: Diego Bardari <diego.bardari@klarna.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-common': minor
|
||||
---
|
||||
|
||||
Exported redactLogLine function to be able to use it in custom loggers.
|
||||
@@ -568,6 +568,11 @@ export type ReadUrlResponseFactoryFromStreamOptions = {
|
||||
etag?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export function redactLogLine(
|
||||
info: winston.Logform.TransformableInfo,
|
||||
): winston.Logform.TransformableInfo;
|
||||
|
||||
// @public
|
||||
export function requestLoggingHandler(logger?: Logger): RequestHandler;
|
||||
|
||||
|
||||
@@ -15,5 +15,10 @@
|
||||
*/
|
||||
|
||||
export * from './formats';
|
||||
export { createRootLogger, getRootLogger, setRootLogger } from './rootLogger';
|
||||
export {
|
||||
createRootLogger,
|
||||
getRootLogger,
|
||||
setRootLogger,
|
||||
redactLogLine,
|
||||
} from './rootLogger';
|
||||
export * from './voidLogger';
|
||||
|
||||
@@ -69,8 +69,10 @@ export function setRootLoggerRedactionList(redactionList: string[]) {
|
||||
/**
|
||||
* A winston formatting function that finds occurrences of filteredKeys
|
||||
* and replaces them with the corresponding identifier.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
function redactLogLine(info: winston.Logform.TransformableInfo) {
|
||||
export function redactLogLine(info: winston.Logform.TransformableInfo) {
|
||||
// TODO(hhogg): The logger is created before the config is loaded, because the
|
||||
// logger is needed in the config loader. There is a risk of a secret being
|
||||
// logged out during the config loading stage.
|
||||
|
||||
Reference in New Issue
Block a user