PVE::CLIHandler - allow to set LOG ID with $ENV{PVE_LOG_ID}
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 4 Jul 2018 08:52:26 +0000 (10:52 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Jul 2018 09:25:41 +0000 (11:25 +0200)
We use this with 'pvesh'.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/PVE/CLIHandler.pm

index 0b93a4b..6eab3c6 100644 (file)
@@ -616,7 +616,8 @@ sub run_cli_handler {
 
     $exename = &$get_exe_name($class);
 
-    initlog($exename);
+    my $logid = $ENV{PVE_LOG_ID} || $exename;
+    initlog($logid);
 
     no strict 'refs';
     $cmddef = ${"${class}::cmddef"};