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

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



Revision: 4058
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4058&view=rev
Author:   tshvr
Date:     2011-11-24 22:11:47 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
allow module loglevel overrides from non-svn config file

Modified Paths:
--------------
    branches/1.3/LedgerSMB/Sysconfig.pm
    branches/1.3/ledgersmb.conf.default

Modified: branches/1.3/LedgerSMB/Sysconfig.pm
===================================================================
--- branches/1.3/LedgerSMB/Sysconfig.pm	2011-11-24 19:37:41 UTC (rev 4057)
+++ branches/1.3/LedgerSMB/Sysconfig.pm	2011-11-24 22:11:47 UTC (rev 4058)
@@ -144,13 +144,22 @@
     ${$var} = $config{mail}{$var} if $config{mail}{$var};
 }
 
+my $modules_loglevel_overrides='';
+my %tmp=%{$config{log4perl_config_modules_loglevel}} if $config{log4perl_config_modules_loglevel};
+for(sort keys %tmp)
+{
+ #print STDERR "Sysconfig key=$_ value=$tmp{$_}\n";
+ $modules_loglevel_overrides=$modules_loglevel_overrides.'log4perl.logger.'.$_.'='.$tmp{$_}."\n";
+}
+#print STDERR localtime()." Sysconfig \$modules_loglevel_overrides=$modules_loglevel_overrides\n";
 # Log4perl configuration
 our $log4perl_config = qq(
     log4perl.rootlogger = $log_level, Basic, Debug
-    #some examples of loglevel setting for modules
-    log4perl.logger.LedgerSMB.DBObject = INFO
-    log4perl.logger.LedgerSMB.Handler = DEBUG
-
+    )
+    .
+    $modules_loglevel_overrides
+    .
+    qq(
     log4perl.appender.Screen = Log::Log4perl::Appender::Screen
     log4perl.appender.Screen.layout = SimpleLayout
     # Filter for debug level
@@ -174,8 +183,16 @@
     log4perl.appender.Basic.layout = PatternLayout
     log4perl.appender.Basic.layout.ConversionPattern = %d - %p %m%n
     log4perl.appender.Basic.Filter = MatchRest
-
 );
+#some examples of loglevel setting for modules
+#FATAL, ERROR, WARN, INFO, DEBUG, TRACE
+#log4perl.logger.LedgerSMB = DEBUG
+#log4perl.logger.LedgerSMB.DBObject = INFO
+#log4perl.logger.LedgerSMB.DBObject.Employee = FATAL
+#log4perl.logger.LedgerSMB.Handler = ERROR
+#log4perl.logger.LedgerSMB.User = WARN
+#log4perl.logger.LedgerSMB.ScriptLib.Company=TRACE
+#print STDERR localtime()." Sysconfig log4perl_config=$log4perl_config\n";
 
 $ENV{PGHOST} = $config{database}{host};
 $ENV{PGPORT} = $config{database}{port};

Modified: branches/1.3/ledgersmb.conf.default
===================================================================
--- branches/1.3/ledgersmb.conf.default	2011-11-24 19:37:41 UTC (rev 4057)
+++ branches/1.3/ledgersmb.conf.default	2011-11-24 22:11:47 UTC (rev 4058)
@@ -82,3 +82,7 @@
 contrib_dir = /usr/share/pgsql/contrib/
 # sslmode can be require, allow, prefer, or disable.  Defaults to prefer.
 sslmode = prefer
+
+[log4perl_config_modules_loglevel]
+LedgerSMB : INFO
+LedgerSMB.DBObject = INFO

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