From e6c10856600c7547ae7eb18f76f6fe3023d824cf Mon Sep 17 00:00:00 2001 From: ramonn Date: Tue, 27 May 2014 15:01:16 +0000 Subject: [PATCH] 2014-05-27 Ramon Novoa * lib/PandoraFMS/Tools.pm: If no logfile is defined print the message to stdout. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10022 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Tools.pm | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 74a3348070..8594258e53 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2014-05-27 Ramon Novoa + + * lib/PandoraFMS/Tools.pm: If no logfile is defined print the message to + stdout. + 2014-05-27 Ramon Novoa * lib/PandoraFMS/Core.pm: Make sure critical_str and warning_str are valid diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index f0b75b350e..2c74e272c3 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -413,6 +413,11 @@ sub logger ($$;$) { $level = 1 unless defined ($level); return if ($level > $pa_config->{'verbosity'}); + if (!defined($pa_config->{'logfile'})) { + print strftime ("%Y-%m-%d %H:%M:%S", localtime()) . " [V". $level ."] " . $message . "\n"; + return; + } + my $file = $pa_config->{'logfile'}; # Log rotation