From 97a30e56dbde2299ab522ae862464866e9ece47d Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 1 Dec 2005 21:02:44 +0000 Subject: [PATCH] added qw(:level) to CDBI.pm because we were getting empty log levels made log output a little more descriptive (more to do) setting log service in math bench slimmed the logging in the gateway git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@594 9efc2488-bf62-4759-914b-345cdb29e865 --- examples/math_bench.pl | 3 +++ src/gateway/mod_ils_gateway.c | 4 +--- src/perlmods/OpenSRF/Utils/Logger.pm | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/math_bench.pl b/examples/math_bench.pl index 2d991f5..c3a504c 100755 --- a/examples/math_bench.pl +++ b/examples/math_bench.pl @@ -2,6 +2,8 @@ use strict; use warnings; use OpenSRF::System; use Time::HiRes qw/time/; +use OpenSRF::Utils::Logger; +my $log = "OpenSRF::Utils::Logger"; # Test script which runs queries agains the opensrf.math service and reports on # the average round trip time of the requests. @@ -12,6 +14,7 @@ print "usage: $0 \n" and exit unless $count; # * connect to the Jabber network OpenSRF::System->bootstrap_client( config_file => "/openils/conf/bootstrap.conf" ); +$log->set_service('math_bench'); # * create a new application session for the opensrf.math service my $session = OpenSRF::AppSession->create( "opensrf.math" ); diff --git a/src/gateway/mod_ils_gateway.c b/src/gateway/mod_ils_gateway.c index 1f5f8bd..28e1337 100644 --- a/src/gateway/mod_ils_gateway.c +++ b/src/gateway/mod_ils_gateway.c @@ -176,9 +176,7 @@ static int mod_ils_gateway_method_handler (request_rec *r) { char* content = jsonObjectToJSON(response); if(content) { - osrfLogInfo( "----------------------------------------------\n" - "Gateway responding with:\n%s\n" - "----------------------------------------------", content ); + osrfLogInfo( "Gateway responding with: %s", content ); ap_rputs(content,r); free(content); } diff --git a/src/perlmods/OpenSRF/Utils/Logger.pm b/src/perlmods/OpenSRF/Utils/Logger.pm index 6d71eb3..607b65d 100644 --- a/src/perlmods/OpenSRF/Utils/Logger.pm +++ b/src/perlmods/OpenSRF/Utils/Logger.pm @@ -200,6 +200,8 @@ sub _log_message { #my( $pack, $file, $line_no ) = @caller; + $msg = "[$n:"."$$".":::] $msg"; + if( $level == ACTIVITY() ) { if( is_act_syslog() ) { syslog( $fac | $l, $msg ); } elsif( is_act_filelog() ) { _write_file( $msg, 1 ); } -- 2.11.0