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