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);
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
@tceriksen you can add that code to the file ´functions.php´ in your theme folder.