Support » Plugin: Simple History » Stop logging certain types of activity

  • Resolved David Wang


    Hi Par, thanks for a great plugin. I’ve been using a lot and have some questions.

    I notice that the database tables grow very large and I want to stop logging failed logins. I already use Wordfence which logs failed logins and Simple History is duplicating that and redundant.

    Is it possible to stop logging failed logins and other activity? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pär Thernström


    It will be possible in the next version (2.0.20), which will add a filter that makes this possible.

    An example that would accomplish what you want:

    // Don't log failed logins
    add_filter("simple_history/simple_logger/log_message_key", function($doLog, $loggerSlug, $messageKey, $SimpleLoggerLogLevelsLevel, $context) {
    	// Don't log login attempts to non existing users
    	if ( "SimpleUserLogger" == $loggerSlug && "user_unknown_login_failed" == $messageKey ) {
    		$doLog = false;
    	// Don't log failed logins to existing users
    	if ( "SimpleUserLogger" == $loggerSlug && "user_login_failed" == $messageKey ) {
    		$doLog = false;
    	return $doLog;
    }, 10, 5);

    Please hang on for 2.0.20 to be released and then try to above!

    (There are more examples of filter usage in the examples.php-file btw.)

    Thank you, great feature and great plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stop logging certain types of activity’ is closed to new replies.