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.
If I'm reading the code of the module correctly, it logs to the database directly. If I understand it correctly, it also looks like it uses watchdog()
just below the database write? I noticed that there's possibly a variable that we can set to override the shutdown function, but that seems a bit convoluted. Would it be possible to disable logging to the database and just use watchdog()
Comment | File | Size | Author |
---|---|---|---|
#4 | services_log-disable-logging-to-db-2650996-4-7.x-3.x.patch | 1.45 KB | Sarwar Zahan |
#2 | services_log-disable-logging-to-db-2650996-2-7.x-1.x.patch | 598 bytes | dannycodes |
Comments
Comment #2
dannycodes CreditAttribution: dannycodes as a volunteer commentedI've thrown together a small patch that checks to see if the module syslog is enabled. If it is then the $record is sent through watchdog. Otherwise it uses drupal_write_record as it normally would.
Filename should end with 7.x-3.x. Just a typo in the filename.
Comment #3
dannycodes CreditAttribution: dannycodes as a volunteer commentedComment #4
Sarwar Zahan CreditAttribution: Sarwar Zahan as a volunteer and commentedFixed the watchdog passing parameters to log the service request in syslog.
Comment #5
Derimagia CreditAttribution: Derimagia as a volunteer and at Mindgrub Technologies commentedThanks for your help here.
I like this but I don't like how it checks to enable this.. Whether the syslog module is enabled seems generic. Syslog has a has a 1kb limit as well.
I'm thinking the best way of implementing this is by having 2 settings, "Call watchdog" and "Write to database". "Write to database" is the default, while Call watchdog is not enabled. Someone can enable both or one if they want to.
Comment #6
rvtraveller CreditAttribution: rvtraveller as a volunteer and at Mindgrub Technologies commentedI agree with @Derimagia. Special-casing syslog doesn't make a ton of sense to me because there are plenty of other logging implementations that a user might be using.
+1 to the 2 different settings. That way those people who are running a more "vanilla" site with just a standard LAMP stack can make use of the database search. Those folks who are running more complex stacks with syslog and Splunk/ELK/whatever (and I 100% believe that you should be using one of those if you are using syslog logging) can log to their more complex workflow that lets them do graphs and charts and such.
Comment #7
texas-bronius CreditAttribution: texas-bronius commentedWhat's the decision here, and how can I help? It's not clear to me from OP and comments above what "write to database" might mean. And we are only talking about meta logging of service API activity, not the actual request/response/details of the call that Services Log will still handle in DB all the time?
-Bronius