[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4015] branches/1.3



Revision: 4015
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4015&view=rev
Author:   tshvr
Date:     2011-11-18 09:30:29 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
get logger with a name,more debug,example of module loglevel setting

Modified Paths:
--------------
    branches/1.3/LedgerSMB/Sysconfig.pm
    branches/1.3/lsmb-request.pl

Modified: branches/1.3/LedgerSMB/Sysconfig.pm
===================================================================
--- branches/1.3/LedgerSMB/Sysconfig.pm	2011-11-18 00:38:18 UTC (rev 4014)
+++ branches/1.3/LedgerSMB/Sysconfig.pm	2011-11-18 09:30:29 UTC (rev 4015)
@@ -146,7 +146,11 @@
 
 # Log4perl configuration
 our $log4perl_config = qq(
-    log4perl.rootlogger = $log_level, Screen, Basic
+    log4perl.rootlogger = $log_level, Basic, Debug
+    #some examples of loglevel setting for modules
+    log4perl.logger.LedgerSMB.DBObject = INFO
+    log4perl.logger.LedgerSMB.Handler = DEBUG
+
     log4perl.appender.Screen = Log::Log4perl::Appender::Screen
     log4perl.appender.Screen.layout = SimpleLayout
     # Filter for debug level

Modified: branches/1.3/lsmb-request.pl
===================================================================
--- branches/1.3/lsmb-request.pl	2011-11-18 00:38:18 UTC (rev 4014)
+++ branches/1.3/lsmb-request.pl	2011-11-18 09:30:29 UTC (rev 4015)
@@ -36,7 +36,7 @@
 use LedgerSMB::CancelFurtherProcessing;
 use strict;
 
-my $logger = Log::Log4perl->get_logger('');
+my $logger = Log::Log4perl->get_logger('LedgerSMB::Handler');
 
 $logger->debug("Begin lsmb-request.pl");
 
@@ -53,6 +53,7 @@
 
 $ENV{SCRIPT_NAME} =~ m/([^\/\\]*.pl)\?*.*$/;
 my $script = $1;
+$logger->debug("\$ENV{SCRIPT_NAME}=$ENV{SCRIPT_NAME} \$request->{action}=$request->{action} \$script=$script");
 
 my $locale;
 
@@ -72,6 +73,7 @@
 $logger->debug("calling $script");
 
 &call_script( $script, $request );
+$logger->debug("after calling script=$script action=$request->{action}");
 
 # Prevent flooding the error logs with undestroyed connection warnings
 $request->{dbh}->disconnect()
@@ -96,6 +98,7 @@
   }
   catch CancelFurtherProcessing with {
     my $ex = shift;
+    $logger->debug("CancelFurtherProcessing \$ex=$ex");
   };
 }
 1;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.