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

Fix azure functions diagnostic logging #2433

Merged
merged 11 commits into from
Aug 10, 2022
Merged

Fix azure functions diagnostic logging #2433

merged 11 commits into from
Aug 10, 2022

Conversation

trask
Copy link
Member

@trask trask commented Aug 4, 2022

No description provided.

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2022

This pull request fixes 1 alert when merging 53cc55c into 0385228 - view on LGTM.com

fixed alerts:

  • 1 for Dereferenced variable may be null

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2022

This pull request fixes 1 alert when merging 21121a8 into 0385228 - view on LGTM.com

fixed alerts:

  • 1 for Dereferenced variable may be null

@trask trask requested a review from heyams August 9, 2022 00:03
@trask
Copy link
Member Author

trask commented Aug 9, 2022

@heyams can you re-review? I've made several additional changes, thx

@lgtm-com
Copy link

lgtm-com bot commented Aug 9, 2022

This pull request fixes 1 alert when merging a82998e into 0385228 - view on LGTM.com

fixed alerts:

  • 1 for Dereferenced variable may be null

@@ -126,7 +126,7 @@ public void onStartupSuccess() {
MDC.put(DiagnosticsHelper.MDC_PROP_OPERATION, "Startup");
try (MDC.MDCCloseable ignored = INITIALIZATION_SUCCESS.makeActive()) {
LoggerFactory.getLogger(DiagnosticsHelper.DIAGNOSTICS_LOGGER_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

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

static final diagnostics logger?

Copy link
Member Author

Choose a reason for hiding this comment

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

we can't here because it would trigger the logger to be initialized too early

@Nullable String statsbeatEndpoint) {

if (Strings.isNullOrEmpty(connectionString)) {
this.connectionString = null;
Copy link
Contributor

@heyams heyams Aug 9, 2022

Choose a reason for hiding this comment

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

is it necessary to set it to null?

if (!Strings.isNullOrEmpty(conenctionString)) {
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is helpful because we have a couple of places that get the connection string / ikey, and then those won't get outdated ones (Azure Spring Cloud can set the connection string to null at runtime)

Comment on lines +523 to +526
if (Strings.isNullOrEmpty(connectionString)) {
this.connectionString = null;
this.statsbeatConnectionString = null;
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (Strings.isNullOrEmpty(connectionString)) {
this.connectionString = null;
this.statsbeatConnectionString = null;
} else {
if (!Strings.isNullOrEmpty(connectionString)) {

@lgtm-com
Copy link

lgtm-com bot commented Aug 10, 2022

This pull request fixes 1 alert when merging 76bbf86 into 1f6f3b5 - view on LGTM.com

fixed alerts:

  • 1 for Dereferenced variable may be null

@trask trask merged commit e8dbd4a into main Aug 10, 2022
@trask trask deleted the fix-az-fn-diag-logger branch August 10, 2022 02:30
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.

2 participants