diff --git a/packages/api-gateway/src/Bootstrap/Container.ts b/packages/api-gateway/src/Bootstrap/Container.ts index deb99de1a..64f4530dd 100644 --- a/packages/api-gateway/src/Bootstrap/Container.ts +++ b/packages/api-gateway/src/Bootstrap/Container.ts @@ -24,7 +24,7 @@ import { CrossServiceTokenCacheInterface } from '../Service/Cache/CrossServiceTo import { RedisCrossServiceTokenCache } from '../Infra/Redis/RedisCrossServiceTokenCache' // eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicWinstonEnricher = require('@newrelic/winston-enricher') +const newrelicFormatter = require('@newrelic/winston-enricher') export class ContainerConfigLoader { async load(): Promise { @@ -33,9 +33,10 @@ export class ContainerConfigLoader { const container = new Container() + const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { - winstonFormatters.push(newrelicWinstonEnricher(winston)) + winstonFormatters.push(newrelicWinstonFormatter()) } const logger = winston.createLogger({ diff --git a/packages/auth/src/Bootstrap/Container.ts b/packages/auth/src/Bootstrap/Container.ts index 16043c71d..dc8907cbc 100644 --- a/packages/auth/src/Bootstrap/Container.ts +++ b/packages/auth/src/Bootstrap/Container.ts @@ -193,7 +193,7 @@ import { PredicateVerificationRequestedEventHandler } from '../Domain/Handler/Pr import { MuteMarketingEmails } from '../Domain/UseCase/MuteMarketingEmails/MuteMarketingEmails' // eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicWinstonEnricher = require('@newrelic/winston-enricher') +const newrelicFormatter = require('@newrelic/winston-enricher') export class ContainerConfigLoader { async load(): Promise { @@ -215,9 +215,10 @@ export class ContainerConfigLoader { container.bind(TYPES.Redis).toConstantValue(redis) + const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { - winstonFormatters.push(newrelicWinstonEnricher(winston)) + winstonFormatters.push(newrelicWinstonFormatter()) } const logger = winston.createLogger({ diff --git a/packages/scheduler/src/Bootstrap/Container.ts b/packages/scheduler/src/Bootstrap/Container.ts index 98883f477..eee1a3adc 100644 --- a/packages/scheduler/src/Bootstrap/Container.ts +++ b/packages/scheduler/src/Bootstrap/Container.ts @@ -38,7 +38,7 @@ import { UserRegisteredEventHandler } from '../Domain/Handler/UserRegisteredEven import { SubscriptionCancelledEventHandler } from '../Domain/Handler/SubscriptionCancelledEventHandler' // eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicWinstonEnricher = require('@newrelic/winston-enricher') +const newrelicFormatter = require('@newrelic/winston-enricher') export class ContainerConfigLoader { async load(): Promise { @@ -60,9 +60,10 @@ export class ContainerConfigLoader { container.bind(TYPES.Redis).toConstantValue(redis) + const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { - winstonFormatters.push(newrelicWinstonEnricher(winston)) + winstonFormatters.push(newrelicWinstonFormatter()) } const logger = winston.createLogger({ diff --git a/packages/syncing-server/src/Bootstrap/Container.ts b/packages/syncing-server/src/Bootstrap/Container.ts index d765e6713..5531c629d 100644 --- a/packages/syncing-server/src/Bootstrap/Container.ts +++ b/packages/syncing-server/src/Bootstrap/Container.ts @@ -86,7 +86,7 @@ import { ItemRepositoryInterface } from '../Domain/Item/ItemRepositoryInterface' import { Repository } from 'typeorm' // eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicWinstonEnricher = require('@newrelic/winston-enricher') +const newrelicFormatter = require('@newrelic/winston-enricher') export class ContainerConfigLoader { private readonly DEFAULT_CONTENT_SIZE_TRANSFER_LIMIT = 10_000_000 @@ -110,9 +110,10 @@ export class ContainerConfigLoader { container.bind(TYPES.Redis).toConstantValue(redis) + const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { - winstonFormatters.push(newrelicWinstonEnricher(winston)) + winstonFormatters.push(newrelicWinstonFormatter()) } const logger = winston.createLogger({