From 7667d34b4913b57740695a912a69f4d520fbcb9f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 17 Oct 2012 14:31:02 -0400 Subject: [PATCH] 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 --- src/perl/lib/OpenSRF/Utils/Logger.pm | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.43.2