mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-20 19:04:59 +00:00
Fix Logger error spamming.
This commit is contained in:
@@ -183,13 +183,15 @@ sub start_online_logging {
|
||||
};
|
||||
if ( my $e = $EVAL_ERROR ) {
|
||||
# Safegaurd: don't spam the agent log file with errors.
|
||||
if ( ++$n_errors > 10 ) {
|
||||
warn "$n_errors consecutive errors, no more error "
|
||||
. "messages will be printed until log entries "
|
||||
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 "
|
||||
. "are sent successfully again.\n";
|
||||
}
|
||||
else {
|
||||
warn "Error sending log entry to API: $e";
|
||||
$n_errors++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user