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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iamEAP’s picture

Status: Active » Needs review
FileSize
3.92 KB

Rather 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.

mondrake’s picture

Looks 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.

iamEAP’s picture

Thanks, 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.

Status: Needs review » Needs work

The last submitted patch, better_statistics-pluggable_accesslog_storage-1880494-3.patch, failed testing.

iamEAP’s picture

Status: Needs work » Needs review
FileSize
4.04 KB

Didn't know Testbot failed on PHP syntax errors in api.php files. Awesome.

Status: Needs review » Needs work

The last submitted patch, better_statistics-pluggable_accesslog_storage-1880494-5.patch, failed testing.

iamEAP’s picture

Status: Needs work » Needs review
FileSize
4 KB
iamEAP’s picture

iamEAP’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.