Douglas Woods
Douglas Woods

Reputation: 964

How to get Logging using oidc-client with Angular

I am using oidc-client with angular 7, and I want to enable logging. The doc suggests that I can do the following

Oidc.Log.logger = console;

I have not been able to make this work as Oidc does not appear to be on the window object??

Upvotes: 9

Views: 6172

Answers (1)

user2341176
user2341176

Reputation: 191

Just add this to your code for javascript

Log.logger = console;
Log.level = Log.DEBUG;

and the correct import

import { Log } from 'oidc-client';

For typescript, add the following

import { Log } from 'oidc-client-ts';
Log.setLogger(console);
Log.setLevel(Log.DEBUG);

Upvotes: 14

Related Questions