• Resolved Adriders

    (@adriders)


    Hi there,

    This tables is grown to many records. (50MB)

    Is the table cleared after some period?

    Kind regards,

    Ardrider

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @adriders,

    The sgs_log_events table logs specific events in your WordPress Application. You can monitor in detail the activity of registered, unknown, and blocked visitors. If your site is being hacked, a user, or a plugin was compromised, you can always use the quick tools to block their future actions.
    By default, the table is automatically cleared every 12 days.

    If you need to decrease the log lifetime you can use the following filter we have provided for that purpose and set it in a specific range between 1 and 12 days.

    add_filter( 'sgs_set_activity_log_lifetime', 'set_custom_log_lifetime' );
    function set_custom_log_lifetime() {
        return 'your-custom-log-lifetime-in-days';
    }

    Kind regards,
    Stoyan

    Stoyan,
    You said: cleared every 12 days.

    Meaning the log starts from zero every 12 days?
    Or entries older then 12 days are cleared?

    Big difference when troubleshooting issues!

    Plugin Support Georgi Ganchev

    (@georgiganchev)

    Hello @drhnews ,

    As mentioned by Stoyan, the table is cleared based on the defined period. 12 days is the default period and using the filtering you are able to reduce that timeframe.

    The table is cleared along with all entries present in it. Meaning the log starts from 0 based on the defined period.

    Best regards,
    Georgi Ganchev

    Well, then let me request a feature update as logs should be round robin with just oldest data being removed.
    Shouldn’t be that hard if using a database for this logging.

    Plugin Support Delyan Delov

    (@delyandelov)

    Hello @drhnews,

    I would like to take a moment to explain how exactly the *_sgs_log_events table is cleared.

    The default logging lifetime is 12 days. This does not mean that the *_sgs_log_events table will be completely emptied every 12 days but rather that all entries older than 12 days will be deleted from the table on a daily basis by the WP cron hook siteground_security_clear_logs_cron.

    If the *_sgs_log_events table is getting too big in size, I would recommend decreasing the log lifetime by using the above-provided filter.

    Thanks, that makes more sense.

    Hi folks,

    SG support advised me to reply to this thread, as I’m having an issue using the filter Stoyan posted. I get the following error:

    Sorry, you are not allowed to access this page. This message was triggered by WordPress core. Call stack: wp_die() wp-admin/includes/menu.php:350

    Any advice on the best way to truobleshoot this, please? I’m attempting to reduce the SGS log expiry, same as OP.

    Plugin Support Delyan Delov

    (@delyandelov)

    Hi @ojs81,

    Could you please provide us with the site you are experiencing the issue with, so we can investigate the case further?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘wp_sgs_log_events – table cleared’ is closed to new replies.