diff --git a/bin/pt-agent b/bin/pt-agent index ec83a93d..21b9c73d 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -4971,9 +4971,9 @@ sub start_online_logging { ); }; if ( my $e = $EVAL_ERROR ) { - if ( ++$n_errors < 10 ) { + if ( ++$n_errors <= 10 ) { warn "Error sending log entry to API: $e"; - if ( $n_errors >= 10 ) { + if ( $n_errors == 10 ) { my $ts = ts(time, 1); # 1=UTC warn "$ts WARNING $n_errors consecutive errors, no more " . "error messages will be printed until log entries " diff --git a/lib/Percona/Agent/Logger.pm b/lib/Percona/Agent/Logger.pm index e0f3d352..1fccf5ec 100644 --- a/lib/Percona/Agent/Logger.pm +++ b/lib/Percona/Agent/Logger.pm @@ -183,9 +183,9 @@ sub start_online_logging { }; if ( my $e = $EVAL_ERROR ) { # Safegaurd: don't spam the agent log file with errors. - if ( ++$n_errors < 10 ) { + if ( ++$n_errors <= 10 ) { warn "Error sending log entry to API: $e"; - if ( $n_errors >= 10 ) { + if ( $n_errors == 10 ) { my $ts = ts(time, 1); # 1=UTC warn "$ts WARNING $n_errors consecutive errors, no more " . "error messages will be printed until log entries "