mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 05:29:30 +00:00
Set logger service and data_ts.
This commit is contained in:
@@ -6759,6 +6759,8 @@ sub run_service {
|
|||||||
my $log_link = $agent->links->{log};
|
my $log_link = $agent->links->{log};
|
||||||
$logger->info("Starting online logging. No more log entries will be printed here. "
|
$logger->info("Starting online logging. No more log entries will be printed here. "
|
||||||
. "Agent logs are accessible through the web interface.");
|
. "Agent logs are accessible through the web interface.");
|
||||||
|
$logger->service($service);
|
||||||
|
$logger->data_ts($prefix);
|
||||||
$logger->start_online_logging(
|
$logger->start_online_logging(
|
||||||
client => $logger_client,
|
client => $logger_client,
|
||||||
log_link => $log_link,
|
log_link => $log_link,
|
||||||
@@ -7179,6 +7181,7 @@ sub send_data {
|
|||||||
my $log_link = $agent->links->{log};
|
my $log_link = $agent->links->{log};
|
||||||
$logger->info("Starting online logging. No more log entries will be printed here. "
|
$logger->info("Starting online logging. No more log entries will be printed here. "
|
||||||
. "Agent logs are accessible through the web interface.");
|
. "Agent logs are accessible through the web interface.");
|
||||||
|
$logger->service($service);
|
||||||
$logger->start_online_logging(
|
$logger->start_online_logging(
|
||||||
client => $logger_client,
|
client => $logger_client,
|
||||||
log_link => $log_link,
|
log_link => $log_link,
|
||||||
@@ -7204,7 +7207,10 @@ sub send_data {
|
|||||||
DATA_FILE:
|
DATA_FILE:
|
||||||
foreach my $data_file ( glob "$service_dir/*.data" ) {
|
foreach my $data_file ( glob "$service_dir/*.data" ) {
|
||||||
(my $meta_file = $data_file) =~ s/\.data/.meta/;
|
(my $meta_file = $data_file) =~ s/\.data/.meta/;
|
||||||
|
my ($data_ts) = $data_file =~ m/\/(\d+)\.\w+/;
|
||||||
|
if ( $data_ts ) {
|
||||||
|
$logger->data_ts($data_ts);
|
||||||
|
}
|
||||||
eval {
|
eval {
|
||||||
# Send the file as-is. The --run-service process should
|
# Send the file as-is. The --run-service process should
|
||||||
# have written the data in a format that's ready to send.
|
# have written the data in a format that's ready to send.
|
||||||
|
Reference in New Issue
Block a user