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.
Similar to how watchdog entries can be stored in the db via dblog or flat system log files via syslog, I think it'd be great to allow arbitrary storage of Statistics API data. Maybe provide an optional sub-module that is syslog-like.
Comments
Comment #1
iamEAP CreditAttribution: iamEAP commentedRather than adding the syslog-like functionality here, I'll leave that open elsewhere. This introduces the capability via hook_better_statistics_log(), which behaves more or less exactly like hook_watchdog().
Also added a somewhat contrived example and documentation to better_statistics.api.php.
Comment #2
mondrakeLooks fine to me.
The plugin integration for ip_geoloc has a feature to 'rewrite' part of the information that was logged already (the geolocation information comes asychronously after the page hit, so I run an update against all the log entries that occurred since the geolocation request). It is key for the module to understand what storage is being used - if not db, then the log entries may not be rewriteable.
So I like the idea of the 'statistics_log_to_db' variable.
It can be RTBCed for me, I just wonder if more reviews can be expected.
Comment #3
iamEAP CreditAttribution: iamEAP commentedThanks, Mondrake. Noticed I made one small error in the the hook_better_statistics_log() implementation; fixed here. I doubt there will be many other reviews, so if Testbot likes this, I'll commit.
Comment #5
iamEAP CreditAttribution: iamEAP commentedDidn't know Testbot failed on PHP syntax errors in api.php files. Awesome.
Comment #7
iamEAP CreditAttribution: iamEAP commentedComment #8
iamEAP CreditAttribution: iamEAP commentedComment #9
iamEAP CreditAttribution: iamEAP commentedCommitted.