Skip to content

Add PSR3 support for logging, instead of syslog/error_log#57

Merged
leoromanovsky merged 2 commits intoEppo-exp:mainfrom
jaugustin:add-psr3-support
Jan 26, 2026
Merged

Add PSR3 support for logging, instead of syslog/error_log#57
leoromanovsky merged 2 commits intoEppo-exp:mainfrom
jaugustin:add-psr3-support

Conversation

@jaugustin
Copy link
Contributor

🎟️ Fixes issue 55
📜 Design Doc: link if applicable

Motivation and Context

Adds flexible, standardized SDK logging via PSR-3 so integrators can route logs (including exception context) to their preferred systems. This improves observability and debugging without relying on syslog/error_log.

Description

  • Added PSR-3 dependency and a new optional logger argument on EppoClient::init and EppoClient::createTestClient.
  • Switched SDK internals (poller/config loader/store) to LoggerAwareTrait and propagate the logger from the client.
  • Replaced internal syslog/error_log calls with PSR-3 calls in SDK runtime paths.
  • Documented how to keep legacy syslog behavior using a PSR-3 logger (e.g., Monolog SyslogHandler).

How has this been documented?

Updated README initialization options to include the new PSR-3 logger and a note on using Monolog SyslogHandler.

How has this been tested?

Unit test executed

Breaking Change?

Yes. This introduces a new dependency on psr/log and modifies initialization signatures; treat as a major version bump.

@jaugustin
Copy link
Contributor Author

This is a first version, there is still 2 syslog call in src/DTO/Bandit/AttributeSet.php and src/DTO/Bandit/Bandit.php but I didn't find a good solution for them.

Options are:

  • inject PSR log in construct or static method, but as they are not services, if feel very wrong, and push burden on the user
  • remove the syslog in those DTO
  • keep as is
  • Set the Logger in EppoClient as static, so it could be used in static context

What do you think ?

@leoromanovsky
Copy link
Member

@jaugustin Thanks for submitting this; I pushed some adjustments, including to your question. How does it look? Please tag me directly for a quickly response.

@jaugustin
Copy link
Contributor Author

@leoromanovsky changes looks good 👍

@leoromanovsky leoromanovsky merged commit e449215 into Eppo-exp:main Jan 26, 2026
1 check passed
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.

[feature] Use PSR-3 for logs

2 participants

Comments