Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The logger definition has the following properties:
- correlationId
- logLevel
- logLevels include:
Error,Warning,Info,Trace, andVerbose
- logLevels include:
- piiLoggingEnabled
You can enable logging in your app as shown below:
import { LogLevel, PublicClientApplication } from '@azure/msal-browser';
export function loggerCallback(logLevel, message) {
console.log(message);
}
@NgModule({
imports: [
MsalModule.forRoot(new PublicClientApplication({
auth: {
clientId: 'Your client ID',
},
system: {
loggerOptions: {
loggerCallback,
piiLoggingEnabled: true,
logLevel: LogLevel.Info
}
}
}))
]
})
The logger can also be set dynamically by using MsalService.setLogger().
this.authService.setLogger(new Logger({
loggerCallback: (logLevel, message, piiEnabled) => {
console.log('MSAL Logging: ', message);
},
piiLoggingEnabled: false,
logLevel: LogLevel.Info
}));