Skip to content

feat: add logging capabilities to ZeroBounce SDK with customizable logger and payload logging - #16

Merged
mihaiborcansst merged 1 commit into
zerobounce:masterfrom
rk-7:feat/enable-customizable-opt-in-logging
Oct 27, 2025
Merged

feat: add logging capabilities to ZeroBounce SDK with customizable logger and payload logging#16
mihaiborcansst merged 1 commit into
zerobounce:masterfrom
rk-7:feat/enable-customizable-opt-in-logging

Conversation

@rk-7

@rk-7 rk-7 commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces a new, configurable logging system for the ZeroBounce SDK, allowing users to integrate SDK logging with their application's logging framework and control the emission of Personally Identifiable Information (PII). The SDK is now silent by default, and logging can be enabled or disabled programmatically. Documentation has been updated to reflect these changes, and tests have been added to verify correct logger behavior.

SDK Logging System Integration

  • Added a minimal logging abstraction interface ZBLogger and a helper class ZBLoggers to adapt common logging frameworks (e.g., JUL) for SDK use. (zero-bounce-sdk/src/main/java/com/zerobounce/ZBLogger.java, zero-bounce-sdk/src/main/java/com/zerobounce/ZBLoggers.java) [1] [2]
  • Updated ZeroBounceSDK to use the new logger, including methods to set the logger and enable/disable payload logging, replacing all direct System.out.println calls with logger invocations. (zero-bounce-sdk/src/main/java/com/zerobounce/ZeroBounceSDK.java) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Documentation Updates

  • Added sections in README.md, documentation.md, and documentation_es.md explaining how to control SDK logging, integrate with application loggers, and avoid logging PII in production. [1] [2] [3]

Testing and Verification

  • Added tests to verify that the default logger emits no console output and that payload logging uses only the configured logger, ensuring no accidental PII leakage via console. (zero-bounce-sdk/src/test/java/com/zerobounce/ZeroBounceSDKTest.java)

These changes make SDK logging safer and more flexible, allowing developers to control log output and integrate with their preferred logging frameworks.

closes: #14

@rk-7

rk-7 commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

There is another approach on PR: #15 .
Please feel free to review/suggest changes/merge one of these PRs and close the other as you find fit.

@vlungusst @andrei-tatomir @picobas @mihaiborcansst @vivek-karimbacheri

@rk-7

rk-7 commented Oct 27, 2025

Copy link
Copy Markdown
Contributor Author

bump

@mihaiborcansst

Copy link
Copy Markdown
Contributor

Thanks for raising this concern and for providing a solution.

I've reviewed both PRs (#15 and #16) and we can go for the 2nd one, which provides more customization options for users. I'll merge this PR and close #15 because it's no longer needed.

@mihaiborcansst
mihaiborcansst merged commit 7357f17 into zerobounce:master Oct 27, 2025
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.

SDK prints API responses (PII) to STDOUT; make logging opt-in & logger-agnostic

2 participants