[pve-devel] [pve-common] PVE::CLIHandler - allow to set LOG ID with $ENV{PVE_LOG_ID}

Dietmar Maurer dietmar at proxmox.com
Wed Jul 4 10:52:26 CEST 2018


We use this with 'pvesh'.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 src/PVE/CLIHandler.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index 0b93a4b..6eab3c6 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -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"};
-- 
2.11.0




More information about the pve-devel mailing list