| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Inspect the Spring Environment before SDK initialization and emit tailored migration warnings for explicit sentry.logs.enabled values without binding or applying the obsolete property. Co-Authored-By: Claude <noreply@anthropic.com>
|
Sorry, something went wrong.
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: feat/warn-legacy-logs-externalStartup times
App size
Previous results on branch: feat/warn-legacy-logs-springStartup times
App size
|
Sorry, something went wrong.
Emit legacy Logs property diagnostics after Sentry.init so the configured diagnostic logger is available. Co-Authored-By: Claude <noreply@anthropic.com>
| Boolean.TRUE.equals(environment.getProperty("sentry.logs.enabled", Boolean.class)); | ||
| if (enableLogs) { |
There was a problem hiding this comment.
Bug: The application will crash on startup if sentry.logs.enabled is set to a non-boolean value, as the call to environment.getProperty lacks error handling for invalid conversions.
Severity: HIGH
Wrap the environment.getProperty("sentry.logs.enabled", Boolean.class) call in a try-catch block to handle ConversionFailedException. Log a warning if the property value is invalid and default to a sensible value (e.g., false) to allow the application to start successfully. This makes the configuration more robust against user error.
Prompt for AI AgentReview the code at the location below. A potential bug has been identified by an AI agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not valid. Location: sentry-spring-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java#L200-L201 Potential issue: The code checks for the existence of the `sentry.logs.enabled` property but does not validate its value before attempting to convert it to a `Boolean`. If a user provides a non-boolean string (e.g., "enabled" instead of "true"), Spring's `StringToBooleanConverter` will throw a `ConversionFailedException`. Since this exception is not caught during the creation of the `sentryHub` bean, it will propagate up and cause the entire Spring application context to fail to initialize, preventing the application from starting.
Also affects:
Did we get this right? 👍 / 👎 to inform future reviews.
Sorry, something went wrong.
There was a problem hiding this comment.
if this is not a regression then this is nothing to worry about. we probably want to fail here anyways.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM 👍
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Stack (Logs and Metrics Enable Flags)
📜 Description
Injects the Spring Environment into SDK initialization for all three Spring Boot variants and detects explicit sentry.logs.enabled configuration. Migration warnings are emitted after Sentry.init, when the diagnostic logger has been initialized.
Both true and false values emit tailored migration warnings. The obsolete property is not restored to SentryProperties and does not affect capture or the new sentry.logging.logs-enabled integration control. Absent configuration emits no warning.
💡 Motivation and Context
After removal of the aggregate Logs option, Spring's relaxed binder ignores the old property. Inspecting the complete Spring Environment preserves a useful migration diagnostic across property files, YAML, environment variables, command-line values, and other property sources.
💚 How did you test it?
📝 Checklist
🔮 Next steps
Avoid starting the Logs batch worker thread until the first accepted Log item.
#skip-changelog