Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Logging options to IPersistenceConfiguration. #5626

Merged
merged 4 commits into from
Feb 3, 2023

Conversation

fredrikhr
Copy link
Contributor

TL;DR

@azure/msal-node-extensions

Adds support for configuring LoggerOptions when creating an IPersistence using PersistenceCreator.createPersistence.

Description

All types implementing IPersistence in the @azure/msal-node-extensions package support a LoggerOptions object as an optional parameter to their static create methods. PersistenceCreator.createPersistence, the factory method creating instances of these types, has currently no way of passing such a LoggerOptions object in to these create methods.

In cases when a custom logger callback is used in MSAL, it is desirable that logging is done consistently across all components being used in MSAL. This PR adds a way for users to customize the logger, allowing for a consistent logging experience.

Implementation

Add a new optional property loggerOptions to the IPersistenceConfiguration interface type. Inside PersistenceCreator.createPersistence this property is simply passed along to all create methods that are called within the factory.

Breaking changes

None. The added property in IPersistenceConfiguration is the only noticeable change to the API surface. If that property is left undefined the previous behavior still applies.

@ghost ghost assigned lalimasharda and sameerag Jan 31, 2023
@github-actions github-actions bot added the extensions Related to extensions for the base libraries label Jan 31, 2023
@tnorling
Copy link
Collaborator

tnorling commented Feb 2, 2023

@fredrikhr Thanks for the PR! Can you please run npm run beachball:change from the root of the repo and commit the changefile it generates? Thanks!

@fredrikhr
Copy link
Contributor Author

@tnorling Does 4f4cf9e look fine?

Copy link
Contributor

@derisen derisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @fredrikhr -one suggestion

@tnorling tnorling merged commit b7d7729 into AzureAD:dev Feb 3, 2023
@ghost
Copy link

ghost commented Feb 6, 2023

🎉@azure/msal-node-extensions@v1.0.0-alpha.30 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions Related to extensions for the base libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants