metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
213 stars 156 forks source link

Support for custom response logging #49

Closed aksl closed 7 years ago

aksl commented 8 years ago

As the title says, would be nice to be able to add a custom logger for written and read responses. Prerably with an access to Request and Response objects, so in writeandread() -method after the default READ log write. I can do some work on this, just need to decide how it gets implemented (event listener, callback or what).

metaregistrar commented 8 years ago

Sounds like a great idea. I always wanted to make a better logging for EPP events, but never got round to doing it.

aksl commented 8 years ago

Made an initial approach to this in https://github.com/aksl/php-epp-client/tree/logging. Thoughts? The plan is to add a eppLogger that passes the log events to Psr\Log\LoggerInterface compliant logger.

aksl commented 8 years ago

@metaregistrar any thoughts on the approach?

metaregistrar commented 8 years ago

Hi Aksl,

I would keep the logging class out of the EPP directory. The logging is not strictly related to EPP, and if it is a basic class it can also be used for TMCH logging, for example. So you can either create a directory for that, or add the classes at the root level. Maybe it is best also not to use the Metaregistrar/EPP namespace but create a separate Metaregistrar/Log or Metaregistrar/Logging namespace for that.