Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML request/response logger #9

Open
jbarbede opened this issue Apr 25, 2015 · 3 comments · May be fixed by #85
Open

XML request/response logger #9

jbarbede opened this issue Apr 25, 2015 · 3 comments · May be fixed by #85

Comments

@jbarbede
Copy link
Contributor

Currently, with debug mode, you echo any XML send request/received response and it is already a great help.

We used to log these XML requests and responses in a database. It is really useful when a command failed and we can't exactly determine why (API response sometimes are not really clear). Like that, we can find a request and its response and send it to the API support.

Maybe we should be able to configure a logger when creating a Client object.

@lifeofguenter
Copy link
Member

Yes that would be a great idea, basically I would suggest to implement something via monolog and fallback to "echo" - so it would basically be a composer-suggests/recommends instead of requirement.

@lifeofguenter lifeofguenter added this to the 0.1.5 milestone Apr 25, 2015
@lifeofguenter lifeofguenter self-assigned this Apr 25, 2015
@lifeofguenter
Copy link
Member

Ok this might be a little more complicated:

  • the reason I implemented (rather shitty) the "log" method is so I can output each byte as soon as it arrives - this is so I can really see everything until to the point of a crash
  • implementing a logger means I would have to call the logger after I received all bytes (which might not work on a crash) and to make it have more sense it would have to add some useful information, like "what command was actually being made" - "what was the actual received xml data"

So conclusion:

  • logger will be a config option (psr-log interface)
  • it is independent of the current debug
  • it will additionally log the Frame class name that was sent

@jbarbede
Copy link
Contributor Author

We used to log also the command type (the Frame class in this case) so the whole conclusion sounds perfect.

@lifeofguenter lifeofguenter modified the milestones: 0.1.6, 0.1.5 May 2, 2015
@lifeofguenter lifeofguenter modified the milestones: 0.1.7, 0.1.6 Nov 30, 2015
@lifeofguenter lifeofguenter removed this from the 0.1.7 milestone Apr 27, 2017
@johnny-bit johnny-bit linked a pull request Oct 30, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants