Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author P?r Thernstr?m

    (@eskapism)

    Yes, you can use a filter to control if a specific message should be logged.

    I think there is an example in the example file that does what you need:

    
    // 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);
    
    tceriksen

    (@tceriksen)

    I am new to this sort of work and need a few instructions to tackle this for myself. Where do I add this chunk of code? I mean in which file and where in the file? I have seen php and js before but I’m not skilled. But I can insert code where I am told ??
    Thanks for a great plugin. It logs beautifully and now I just need to hide all the login attempts from bots, because I have one attempt every 4 min 24 hours a day. I like Simple History because of the logs of user activity.

    Have a great day! BR Thomas Eriksen

    Plugin Author P?r Thernstr?m

    (@eskapism)

    @tceriksen you can add that code to the file ′functions.php′ in your theme folder.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable logging login attempts?’ is closed to new replies.