Skip to content

Automatically use SentryOptions.Logs.BeforeSendLogCallback Spring beans - #4509

Merged
adinauer merged 20 commits into
mainfrom
feat/spring-boot-before-send-log
Jun 25, 2025
Merged

adinauer merged 20 commits into
mainfrom
feat/spring-boot-before-send-log

Conversation

@adinauer

Copy link
Copy Markdown
Member

📜 Description

Automatically wire up spring beans of type SentryOptions.Logs.BeforeSendLogCallback into Sentry configuration.

  @Bean
  public SentryOptions.Logs.BeforeSendLogCallback beforeSendLogs() {
    return (log) -> {
      if (log.getBody().contains("purchase")) {
        return null;
      }
      return log;
    };
  }

💡 Motivation and Context

Makes it easier to use Sentry Logs with Spring Boot

💚 How did you test it?

📝 Checklist

  • 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.
  • I updated the wizard 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

@github-actions

github-actions Bot commented Jun 23, 2025

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 1f508a6

@github-actions

github-actions Bot commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 417.24 ms 465.96 ms 48.72 ms
Size 1.58 MiB 2.09 MiB 519.08 KiB

Previous results on branch: feat/spring-boot-before-send-log

Startup times

Revision Plain With Sentry Diff
6c25e3a 383.16 ms 413.46 ms 30.30 ms

App size

Revision Plain With Sentry Diff
6c25e3a 1.58 MiB 2.09 MiB 518.85 KiB

@lcian lcian 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.

Looks good to me

Base automatically changed from feat/logback-spring-boot to main June 25, 2025 07:24
@adinauer
adinauer merged commit 1528dfb into main Jun 25, 2025
@adinauer
adinauer deleted the feat/spring-boot-before-send-log branch June 25, 2025 07:51
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