79573060

Date: 2025-04-14 11:45:03
Score: 0.5
Natty:
Report link

If you want to have the configuration in another file you would use:

importProvidersFrom(
        LoggerModule.forRoot(undefined, {
            configProvider: NGX_FACTORY_PROVIDER,
            ruleProvider: NGX_RULE_PROVIDER,
        }),
    ),

undefined refers to the default config but since i'm using a configuration provider, it's undefined.

In my config file i have:

export const NGX_RULE_PROVIDER: ClassProvider = {
    provide: TOKEN_LOGGER_RULES_SERVICE,
    useClass: LoggerRules,
}

export const NGX_FACTORY_PROVIDER: FactoryProvider = {
    provide: TOKEN_LOGGER_CONFIG,
    useFactory: loggerConfigFactory,
    deps: [ConfigService],
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: nts_98