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.
It would be great if the statistics module allowed users to select the option NEVER (in the module settings) for when to discard old access logs. I'm doing long term data collection about my website usage and I don't want my usage data to be reset when it becomes older than 4 months...
Thanks in advance,
Leo
Comment | File | Size | Author |
---|---|---|---|
#20 | 49941_backport.patch | 1.98 KB | bdragon |
#12 | 49941-discard-never.patch | 2.11 KB | davyvdb |
#4 | statistics-discard.patch | 2.5 KB | geodaniel |
Comments
Comment #1
magico CreditAttribution: magico commentedComment #2
ChrisBryant CreditAttribution: ChrisBryant commented+1 vote for this as well. Additionally, a setting for archiving the data at an interval would be ideal. That way the table size could be kept down but the data would still exist, maybe downloaded as csv.
Chris
PS: I'm not sure if this should be 5.x-dev or 6.x-dev (probably 6.x I assume but it's set for 5.x for now.)
Comment #3
geodaniel CreditAttribution: geodaniel commentedSounds like a sensible suggestion. I'd also like to add a few more options of 26 and 52 weeks to extend it a little.
As for archiving, you could always do that directly from your database as and when required...
(moved to 6.x-dev as no new features will make it into 5.x now as far as I'm aware)
Comment #4
geodaniel CreditAttribution: geodaniel commentedI've rolled a patch against current HEAD that:
Comment #5
Chris Johnson CreditAttribution: Chris Johnson commented+1 to the idea of allowing never and longer periods of data collection, e.g. Dan's 26 and 52 week periods.
Patch looks good on inspection (I have not tested it).
Comment #6
geodaniel CreditAttribution: geodaniel commentedI've also been thinking of other ways to make it more flexible, so people aren't limited to set periods, and could enter their own. I'm not entirely sure I like it, but one way I thought of doing this would be to have two fields: a text field for an integer and a dropdown selection box with 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months' (? not fixed period) or 'years'.
Comment #7
peterx CreditAttribution: peterx commentedPatch is working on my 5.0 sites and replaces nicely some code I added to 4.6. For those who want complete control over deletion, the deletion could be moved to a function that is called with the date for deletion. External modules could then request the deletion. The deletion could be added to an archive module that copies the log to an archive then requests the deletion. You would need a matching data request function so someone could request:
Comment #8
ChrisBryant CreditAttribution: ChrisBryant commentedSometimes there is also the need to completely reset, so that might be good to add an option for "Reset Logs" as well. I guess it could be done with the date changes that geodaniel suggested but say to delete at the current date/time.
Comment #9
bdragon CreditAttribution: bdragon commentedPatch no longer applies due to the page split.
Comment #10
Dave ReidMoving up to Drupal 7.
Comment #11
Dave ReidAdding the novice tag. Anyone want to pick this up?
Comment #12
davyvdb CreditAttribution: davyvdb commentedComment #13
davyvdb CreditAttribution: davyvdb commentedWhy not do this for dblog too? http://drupal.org/node/560484
Comment #14
mgifford+1
I like the idea of never discarding it. Patch applies cleanly.
Comment #15
janusman CreditAttribution: janusman commentedWorks.
Comment #16
webchickMakes sense to me. Committed to HEAD!
Comment #18
ahjota CreditAttribution: ahjota commentedWould like to see this in D6 as well. Doesn't seem too hard, but I don't have any experience with the patch system (yet).
Comment #19
Dave ReidComment #20
bdragon CreditAttribution: bdragon commentedHere's a quick backport.
Comment #21
jzacsh CreditAttribution: jzacsh commentedseems to work. option is available. however, i'm not sure how legitimate of a review this is, seeing as I'd have to set my clock forward on my system, to see if the logs ever get discarded, and thus watch the patch in action/time.
works, though, from what I can tell.
Comment #22
Gábor HojtsyCommitted, thanks.