From: Bill Erickson Date: Wed, 17 Oct 2012 18:31:02 +0000 (-0400) Subject: Enable client logtrace with environment vars X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7667d34b4913b57740695a912a69f4d520fbcb9f;p=working%2FOpenSRF.git Enable client logtrace with environment vars Supports a new environment variable OSRF_LOG_CLIENT which, if true, enables control and generation of the client log trace value. This is the same as setting true within the opensrf core configuration file. As a shortcut, if the MOD_PERL environment variable is set, assume client=true. This allows clients and non-clients to share an opensrf core configuration file, when previously the only difference between the two was the setting. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/src/perl/lib/OpenSRF/Utils/Logger.pm b/src/perl/lib/OpenSRF/Utils/Logger.pm index 2a450ae..be13ecd 100644 --- a/src/perl/lib/OpenSRF/Utils/Logger.pm +++ b/src/perl/lib/OpenSRF/Utils/Logger.pm @@ -109,6 +109,12 @@ sub set_config { } my $client = OpenSRF::Utils::Config->current->bootstrap->client(); + + if ($ENV{OSRF_LOG_CLIENT} or $ENV{MOD_PERL}) { + $isclient = 1; + return; + } + if (!$client) { $isclient = 0; return;