Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Right now, it's not easy for non-developers to inspect webservice calls (eg, people on the testing team). I think we need an option to enable logging, which would log details of web service calls to the dblog (watchdog).
Comment | File | Size | Author |
---|---|---|---|
#9 | wsclient-option-to-log-web-1801200-9.patch | 7.73 KB | dman |
#6 | wsclient_debug-1801200-5.patch | 6.79 KB | boyan.borisov |
#5 | wsclient_debug-1801200-4.patch | 6.58 KB | boyan.borisov |
#2 | wsclient_soap_add_trace.patch | 949 bytes | blainelang |
Comments
Comment #1
klausiSounds like a good idea. I'm a bit buried with other work, but I'm happy to review any patches.
Comment #2
blainelang CreditAttribution: blainelang commentedAttached is a patch that I use to see the details of the SOAP request and SOAP Response from the actual __soapCall method. I was calling the wsclient defined service in my own module but looked for a way to add a global setting in the wsclient admin screen but did not see a good place. Still this is part of a solution for extra debugging detail.
To enable trace detail, this is how I setup the service to make the SOAP call in my module
Normally, I use the devel dsm() to show extra debugging info to the screen (requires the devel module) and the debug function is part of drupal. Having it also write to the log file as an option would be nice to have in the final solution.
Comment #3
klausiTesting web services is now somewhat covered by the new wsclient_tester submodule that got committed.
An option for more logging would still be nice. The current patch does that only for SOAP services and there is no setting on the actual wsclient_service entity, so this needs some work.
Comment #4
boyan.borisov CreditAttribution: boyan.borisov commentedI've created a patch which expose a debug setting in the wsclient_service entity. There are 3 levels of the debug:
- No debug
- Enables logging with watchdog
- Enables logging with watchdog and dsm - requires devel module
Also the patch implements debug logging for the both default client services - rest and soap.
Comment #5
boyan.borisov CreditAttribution: boyan.borisov commentedI realized that I've missed to upload the patch :)
Comment #6
boyan.borisov CreditAttribution: boyan.borisov commentedI am adding a new patch with a few improvements:
- rest client headers are added in the trace debug message
- execution time of a API method is added in the trace debug message
Comment #7
lrodarte CreditAttribution: lrodarte commentedHi,
I've applied the patch (wsclient_debug_1801200-5.patch) and I do see the 3 levels of debug options.
What information is specifically being logged? I am using WSclient with Rules, and am interested in seeing the XML that is sent to the web service endpoint (I need to see if I am building out the XML properly). I've looked in the dblog and have being looking at Devel, but am not sure what information is being logged (and I don't see the XML either).
I come from a product management/design background, so please pardon me if I am asking something dumb.
Many thanks.
Comment #8
vistree CreditAttribution: vistree commentedIs this path supposed also to log to watchdog when using tester? I don't get any entries inside dblog.
Comment #9
dman CreditAttribution: dman commentedRe-roll and repaired for conflicts. Several code tidy-ups. I still think this needs work though, it's a bit clunky and puts a LOT of heavy response data into the watchdog when run on significant transactions