Attached is a patch that will look at the DEBUG setting on the endpoint being requested and only log details about the request if this is enabled.

In my installation i have several services request set up and when debugging issues with requests, i wanted to be able to enable logging for specific endpoints that had issues. So i modified the code to look at the DEBUG setting on the endpoint and only log if enabled, now i can have services logging enabled all the time and nothing will be logged until i enable the DEBUG option on the endpoint i want logging for.

Thought i would create this patch incase this would be useful to anyone else.

CommentFileSizeAuthor
per-endpoint-logging.patch1.33 KBPsycle Interactive
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Derimagia’s picture

Status: Active » Needs work

Interesting idea. If anyone needs this and wants to submit a patch that has this as a setting I'll merge it in.

rvtraveller’s picture

I haven't tested the patch here but I think it still needs a bit of work. If debug isn't set on the request prior to this patch going in then all of the existing sites who use this module and upgrade would have the logging for their endpoints stop, right?

texas-bronius’s picture

I like this idea but thought of a different approach. What do y'all think about keeping them as separate concerns and instead either:

* hook_form_alter the default Services form to provide a per-endpoint logging option as OP proposes, or
* manage the list of loggable endpoints in the Services Log config screen (where we already select actions to log)

With this new option, existing service endpoints can log by default (as is currently the case) and selectively turn off logging by endpoint. I think there is value to keeping "Debug" mode provided and used Services module unfettered for folks who are not using the Services Log module.

-Bronius