Jump to:
| Project: | Services |
| Version: | 6.x-0.13 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
It would be nice to have a watchdog for services.
Why not use watchdog itself? Because web service request are not typical browser requests, they don't include a referrer, and so on. And I don't want to lose the log items (by cron), so that I can generate usage statistics per service method, API key, hour, ...
The attached patch is made using diff (without cvs) because otherwise I couldn't get the new files into the patch.
The services log module is made as a separate, optional module.
9 log levels are defined: SERVICES_STATS_UNKNOWNMETHOD, SERVICES_STATS_MISSINGREQUIREDARGUMENTS, SERVICES_STATS_EXPIREDTOKEN, SERVICES_STATS_USEDTOKEN, SERVICES_STATS_INVALIDHASH, SERVICES_STATS_INVALIDKEY, SERVICES_STATS_INVALIDSESSION, SERVICES_STATS_ACCESSDENIED, SERVICES_STATS_SUCCESS
I don't know if this is the best way to do it, but it works for me, for now.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| 20090114_services6.x-0.13_log.patch | 10.63 KB | Ignored: Check issue status. | None | None |
| 20090114_services6.x-0.13_log.png | 22.79 KB | Ignored: Check issue status. | None | None |
Comments
#1
I quite like idea but I don't like the idea of having our own loging method simply because it prevents the module leveraging the ability of drupal core to allow for different logging methods. I would much rather see something based around hook_watchdog that provides the option for service specific logging. Ie if the type isn't services the method just ignores and continues.
#2
In my original post I explained why I think drupal core logging method (hook_watchdog) doesn't suit.
But I'd also prefer using drupal core or an existing (contrib) module...
Any hint, someone?
#3
I don't like implementing a separate services log either. I am leaning towards using the method in #635960: Logging hook and one more generic hook for this. It would involve implementing a hook (or two) that fires when services are called. You can them implement whatever logging or reporting you want in response to that hook. This is very flexible and would offer a wide variety of options to developers.
Marking this as duplicate.