Skip to content

Update logging with SDK model - #367

Merged
Amer Jusupovic (amerjusupovic) merged 37 commits into
previewfrom
ajusupovic/http-logging
Mar 21, 2023
Merged

Amer Jusupovic (amerjusupovic) merged 37 commits into
previewfrom
ajusupovic/http-logging

Conversation

@amerjusupovic

@amerjusupovic Amer Jusupovic (amerjusupovic) commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@amerjusupovic
Amer Jusupovic (amerjusupovic) marked this pull request as draft November 23, 2022 22:16
@zhenlan

Copy link
Copy Markdown
Member
<TargetFramework>net5.0</TargetFramework>

net5.0 is out of support. We should update the example to net6.0 or net7.0. How about you do that in a separate PR including any dependency package update?


Refers to: examples/ConsoleAppWithFailOver/ConsoleAppWithFailOver.csproj:5 in a1d8039. [](commit_id = a1d8039, deletion_comment = False)

@amerjusupovic
Amer Jusupovic (amerjusupovic) marked this pull request as ready for review December 5, 2022 18:57
@amerjusupovic
Amer Jusupovic (amerjusupovic) marked this pull request as draft December 5, 2022 19:00
@amerjusupovic
Amer Jusupovic (amerjusupovic) marked this pull request as ready for review December 7, 2022 17:54
Comment thread src/Microsoft.Extensions.Configuration.AzureAppConfiguration/Logger.cs Outdated
Comment thread tests/Tests.AzureAppConfiguration/FeatureManagementTests.cs Outdated

@avanigupta Avani Gupta (avanigupta) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add the Copyright header in all new files?

@avanigupta

Copy link
Copy Markdown
Member

Jimmy Campbell (@jimmyca15) Zhenlan Wang (@zhenlan) can you take another look at this PR so it can be closed?


public Logger(ILogger logger)
{
_logger = logger;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The expectation of this constructor is logger is not null right? If so, needs null check.

else
{
_logger.LogWarning($"Ignoring the push notification received for the unregistered endpoint '{pushNotification.ResourceUri}'");
_logger.LogWarning(LoggingConstants.PushNotificationUnregisteredEndpoint + pushNotification.ResourceUri + ".");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some places use Build paradigm, some don't. What dictates the decision?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, it looks like LoggingConstants.PushNotificationUnregisteredEndpoint includes an opening ', which isn't closed here. Does look like a good fit for parameterized string with string.format.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or the pattern established in LogHelper already.

else
{
_logger.LogWarning($"Ignoring the push notification received for the unregistered endpoint '{pushNotification.ResourceUri}'");
_logger.LogWarning(LoggingConstants.PushNotificationUnregisteredEndpoint + pushNotification.ResourceUri + ".");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, it looks like LoggingConstants.PushNotificationUnregisteredEndpoint includes an opening ', which isn't closed here. Does look like a good fit for parameterized string with string.format.

else
{
_logger.LogWarning($"Ignoring the push notification received for the unregistered endpoint '{pushNotification.ResourceUri}'");
_logger.LogWarning(LoggingConstants.PushNotificationUnregisteredEndpoint + pushNotification.ResourceUri + ".");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or the pattern established in LogHelper already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding logging for TryRefreshAsync method

4 participants