question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging configuration not working

See original GitHub issue

Please follow the issue template below. Failure to do so will result in a delay in answering your question.

Library

  • msal@1.x.x or @azure/msal@1.x.x
  • @azure/msal-browser@2.2.0
  • @azure/msal-angular@0.x.x
  • @azure/msal-angular@1.x.x
  • @azure/msal-angularjs@1.x.x

Description

Logging is not triggered with configuration.

Error Message

Logging is not triggered with configuration object PublicClientApplication

Security

  • Is this issue security related? no

Regression

  • Did this behavior work before? yes (msal version, it just worked) Version:

MSAL Configuration

const AZURE_CONFIG: Configuration = {
  auth: {
    authority,
    clientId: AZURE_ID,
  },
  cache: {
    cacheLocation: 'localStorage',
  },
  system: {
    loggerOptions: {
      loggerCallback: () => {
        console.log('triggered');
      },
      piiLoggingEnabled: false,
      logLevel: LogLevel.Verbose,
    },
  },
};

const azureProvider = new PublicClientApplication(AZURE_CONFIG);

Expected behavior

Log all stuff happening in Verbose mode. In the case of the configuration above, it should log ‘triggered’.

Browsers/Environment

  • Chrome
  • Firefox
  • Edge
  • Safari
  • IE
  • Other (Please add browser name here)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tnorlingcommented, Oct 8, 2020

@vinceve Looks like you’re calling acquireTokenByRefreshToken. This function always makes a network call and is intended to only be used internally by msal. You should not call this directly as it is subject to change or be removed at any time. You should use acquireTokenSilent instead which will first do a cache lookup, then attempt to refresh if the token is expired or can’t be found in cache.

0reactions
github-actions[bot]commented, Oct 31, 2020

This issue has been closed due to inactivity. If this has not been resolved please open a new issue. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

spring boot, logback and logging.config property
I found a solution and I understood why spring doesn't use my 'logging.config' property defined in the application.properties file.
Read more >
Logging Configuration Not working
I have override logger configuration 'org.apache.sling.commons.log.LogManager.config' under apps through the code and it is not picked up by ...
Read more >
logging.config — Logging configuration — Python 3.11.1 ...
If the configuration dict is constructed using Python code, this is straightforward, but a problem arises when the configuration is provided via a...
Read more >
Bug: Can't set Logging:LogLevel:Default via environment ...
The problem only happens when you have 3 levels. Removing one level and configuration works as expected. That is:.
Read more >
83.1 Configure Logback for Logging - Spring
Spring Boot has a LoggingSystem abstraction that attempts to configure logging based on the content of the classpath. If Logback is available, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found