Skip to main content

Custom Logger

import { AbstractLoggerService } from 'angular-auth-oidc-client';

@Injectable()
export class MyLoggerService implements AbstractLoggerService {
// ...
}

Usage

Standalone

Include the logger class within the ApplicationConfig:

export const appConfig: ApplicationConfig = {
providers: [
provideAuth({
config: {
// ...
},
}),
{ provide: AbstractLoggerService, useClass: MyLoggerService },
],
};

NgModule

Provide the logger class in the module:

@NgModule({
imports: [
AuthModule.forRoot({
config: {
// ...
},
}),
],
providers: [{ provide: AbstractLoggerService, useClass: MyLoggerService }],
exports: [AuthModule],
})
export class AuthConfigModule {}