Jump to content

WHOIS lookup log: the most useless log in the galaxy?


Remitur

Recommended Posts

Doing ordinary maintenance on WHMCS db,  I asked myself a question: what's the goal of Whois lookup log?
Just thousands of useless records, with timestamp and the name of the domain checked... 

Am I missing anything? Does exist any situation where this kind of information may be somehow useful?

Right now, the only  purpose I can find for this log is make us wasting time pruning it on a monthly basis...

 

Link to comment
Share on other sites

  • 3 weeks later...

I can't work it out either..  and.. there is no way to automatically prune it.. you'll need some mysql/phpmyadmin (as you are no doubt aware). 

 

I use (just to help others who find this thread):

Quote

DELETE FROM `tbllog_register` WHERE `created_at` < "2021-01-01"

Replace the date with the oldest date you want to keep.. anything before then will be deleted... of course you will want to select the correct database first.

Edited by xyzulu
Link to comment
Share on other sites

On 10/2/2021 at 11:00 AM, xyzulu said:

I use (just to help others who find this thread):

Replace the date with the oldest date you want to keep.. anything before then will be deleted... of course you will want to select the correct database first.

I've just setup a simple script to do this (and get rid of other useless stuff):

function logcleaner($vars) {
  
    if (date('H') == '12' && intval(date('i')) < 5) {
       $deletedtblwhoislog=Capsule::table('tblwhoislog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->delete();
       $deletedtblactivitylog=Capsule::table('tblactivitylog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('description','LIKE','%Automated Task: Starting%')->delete();
       $deletedtblactivitylog2=Capsule::table('tblactivitylog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('description','LIKE','%Domain Sync Cron: Completed%')->delete();
       $deletedtblactivitylog3=Capsule::table('tblactivitylog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('description','LIKE','%Cron running at%')->delete(); 
       $deletedtbldns1=Capsule::table('dns_manager2_log')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('value','LIKE','Cron Log Cleaner Started')->delete(); 
       $deletedtbldns2=Capsule::table('dns_manager2_log')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('value','LIKE','Cron Cleaner Started')->delete(); 
       $deletedtbldns3=Capsule::table('dns_manager2_log')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('value','LIKE','Cron Status Zone Started')->delete(); 
      
      
      
      logActivity('log cleaning: tblwhoislog deleted '.$deletedtblwhoislog.' records - tblactivitylog deleted '.($deletedtblactivitylog+$deletedtblactivitylog2+$deletedtblactivitylog3).' records - dns_manager2_log deleted '.($deletedtbldns1+$deletedtbldns2+$deletedtbldns3).' records');
    }  
}

add_hook("AfterCronJob",5,"logcleaner");

This script runs daily, at a given hour (in the example code, every day at 12:00).
In the example, there's the code to clean also of dns_manager2_log, useful only if you're using the DNS Manager Addon module by Modulesgarden)

ref: https://domainregister.international/index.php/knowledgebase/667/WHMCS---Automated-Log-Cleaning-Hook.html

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated