Fix #482: Add timestamps to backup create task log

Adding timestamps to the log messages facilitates troubleshooting.

We only log this in the task log, as the syslog and the backup log
(stored together with the backup on the target storage) already have
date/time prefixed, so only the task log missed this info in case of
multiple backups tasks for a single job.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
This commit is contained in:
Dominic Jäger 2019-04-23 09:04:49 +02:00 committed by Thomas Lamprecht
parent e1c20e2a77
commit 29f26f6ddb

View File

@ -827,7 +827,8 @@ sub exec_backup_task {
unlink $logfile;
debugmsg ('info', "Starting Backup of VM $vmid ($vmtype)", $logfd, 1);
debugmsg ('info', "Starting Backup of VM $vmid ($vmtype)", $logfd, 1);
debugmsg ('info', "Backup started at " . strftime("%F %H:%M:%S", localtime()));
$plugin->set_logfd ($logfd);
@ -1043,6 +1044,7 @@ sub exec_backup_task {
$task->{state} = 'err';
$task->{msg} = $err;
debugmsg ('err', "Backup of VM $vmid failed - $err", $logfd, 1);
debugmsg ('info', "Failed at " . strftime("%F %H:%M:%S", localtime()));
eval { $self->run_hook_script ('backup-abort', $task, $logfd); };
@ -1050,6 +1052,7 @@ sub exec_backup_task {
$task->{state} = 'ok';
my $tstr = format_time ($delay);
debugmsg ('info', "Finished Backup of VM $vmid ($tstr)", $logfd, 1);
debugmsg ('info', "Backup finished at " . strftime("%F %H:%M:%S", localtime()));
}
close ($logfd) if $logfd;