← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13590: Better exception logging for startup routines

 

------------------------------------------------------------
revno: 13590
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-01-06 15:05:47 +0100
message:
  Better exception logging for startup routines
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/startup/StartupListener.java	2014-01-06 14:05:47 +0000
@@ -37,6 +37,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.system.util.DebugUtils;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
 
@@ -47,7 +48,7 @@
 public class StartupListener
     implements ServletContextListener
 {
-    private static final Log LOG = LogFactory.getLog( StartupListener.class );
+    private static final Log log = LogFactory.getLog( StartupListener.class );
 
     // -------------------------------------------------------------------------
     // ServletContextListener implementation
@@ -64,10 +65,12 @@
 
         try
         {
-            startupRoutineExecutor.execute();
+            startupRoutineExecutor.execute();            
         }
         catch ( Exception ex )
         {
+            log.error( DebugUtils.getStackTrace( ex ) );
+            
             throw new RuntimeException( "Failed to run startup routines: " + ex.getMessage(), ex );
         }
     }
@@ -83,11 +86,11 @@
             try
             {
                 DriverManager.deregisterDriver( driver );
-                LOG.info( "De-registering jdbc driver: " + driver );
+                log.info( "De-registering jdbc driver: " + driver );
             }
             catch ( SQLException e )
             {
-                LOG.info( "Error de-registering driver " + driver + " :" + e.getMessage() );
+                log.info( "Error de-registering driver " + driver + " :" + e.getMessage() );
             }
         }
     }