From 662e86c1c2c2b728724d75fb4c0b3ca0109d2f70 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Oct 2019 10:31:59 +0200 Subject: [PATCH] Improved solution --- pandora_server/lib/PandoraFMS/Tools.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 4cb203d129..85248ed99b 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -652,7 +652,9 @@ sub logger ($$;$) { # Obtain the script that invoke this log my $parent_caller = ""; if (($parent_caller = ( caller(2) )[1]) ne "") { - $parent_caller = " ** " . (split '/', $parent_caller)[-1] . " **:"; + $parent_caller = (split '/', $parent_caller)[-1]; + $parent_caller =~ s/\.[^.]+$//; + $parent_caller = " ** " . $parent_caller . " **:"; } open (FILE, ">> $file") or die "[FATAL] Could not open logfile '$file'"; # Get an exclusive lock on the file (LOCK_EX)