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

Change log level from INFO to WARN for error message indicating a failed Log4j2 Sentry.init #2606

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

johnnywiller
Copy link
Contributor

📜 Description

Changed INFO level logging to WARN when failing to initialise

💡 Motivation and Context

Normally log4j appenders are configured to show only warnings, and is also the example on the official page
https://docs.sentry.io/platforms/java/guides/log4j2/.

With that, if Sentry fails to initialise due to e.g missing DSN, the user has no useful feedback.

💚 How did you test it?

I didn't find necessary to add a test for the logging

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@johnnywiller johnnywiller changed the title Failing to initialise should log as Warn Failing to initialise should log as WARN Mar 15, 2023
Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

Thanks @johnnywiller for fixing 🚀 ! I just added the changelog. I tested manually. Agree that this doesn't need an extra test.

@adinauer adinauer changed the title Failing to initialise should log as WARN Change log level from INFO to WARN for error message indicating a failed Log4j2 Sentry.init Mar 16, 2023
@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (550d8ec) 81.30% compared to head (3bc0fc5) 81.30%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2606   +/-   ##
=========================================
  Coverage     81.30%   81.30%           
  Complexity     4186     4186           
=========================================
  Files           336      336           
  Lines         15484    15484           
  Branches       2022     2022           
=========================================
  Hits          12589    12589           
  Misses         2101     2101           
  Partials        794      794           
Impacted Files Coverage Δ
...src/main/java/io/sentry/log4j2/SentryAppender.java 87.27% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adinauer adinauer merged commit 5bebc56 into getsentry:main Mar 16, 2023
romtsn pushed a commit that referenced this pull request Mar 16, 2023
…led Log4j2 Sentry.init (#2606)

Co-authored-by: Johnny Goncalves <j.goncalves@ocado.com>
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
Co-authored-by: Alexander Dinauer <alexander.dinauer@sentry.io>
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