Author: violetagg Date: Thu Apr 24 12:50:39 2014 New Revision: 1589698 URL: http://svn.apache.org/r1589698 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56382 Add information about finished deployment and its execution time to the logs. Patch provided by Danila Galimov.
Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1589698&r1=1589697&r2=1589698&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Thu Apr 24 12:50:39 2014 @@ -514,9 +514,11 @@ public class HostConfig DeployedApplication deployedApp = new DeployedApplication(cn.getName(), true); + long startTime = 0; // Assume this is a configuration descriptor and deploy it if(log.isInfoEnabled()) { - log.info(sm.getString("hostConfig.deployDescriptor", + startTime = System.currentTimeMillis(); + log.info(sm.getString("hostConfig.deployDescriptor", contextXml.getAbsolutePath())); } @@ -646,6 +648,11 @@ public class HostConfig if (host.findChild(context.getName()) != null) { deployed.put(context.getName(), deployedApp); } + + if (log.isInfoEnabled()) { + log.info(sm.getString("hostConfig.deployDescriptor.finished", + contextXml.getAbsolutePath(), Long.valueOf(System.currentTimeMillis() - startTime))); + } } @@ -876,10 +883,13 @@ public class HostConfig DeployedApplication deployedApp = new DeployedApplication(cn.getName(), xml.exists() && deployXML && copyThisXml); + long startTime = 0; // Deploy the application in this WAR file - if(log.isInfoEnabled()) + if(log.isInfoEnabled()) { + startTime = System.currentTimeMillis(); log.info(sm.getString("hostConfig.deployWar", war.getAbsolutePath())); + } try { // Populate redeploy resources with the WAR file @@ -935,6 +945,11 @@ public class HostConfig } deployed.put(cn.getName(), deployedApp); + + if (log.isInfoEnabled()) { + log.info(sm.getString("hostConfig.deployWar.finished", + war.getAbsolutePath(), Long.valueOf(System.currentTimeMillis() - startTime))); + } } @@ -984,10 +999,13 @@ public class HostConfig protected void deployDirectory(ContextName cn, File dir) { + long startTime = 0; // Deploy the application in this directory - if( log.isInfoEnabled() ) + if( log.isInfoEnabled() ) { + startTime = System.currentTimeMillis(); log.info(sm.getString("hostConfig.deployDir", dir.getAbsolutePath())); + } Context context = null; File xml = new File(dir, Constants.ApplicationContextXml); @@ -1099,6 +1117,11 @@ public class HostConfig } deployed.put(cn.getName(), deployedApp); + + if( log.isInfoEnabled() ) { + log.info(sm.getString("hostConfig.deployDir.finished", + dir.getAbsolutePath(), Long.valueOf(System.currentTimeMillis() - startTime))); + } } Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=1589698&r1=1589697&r2=1589698&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties Thu Apr 24 12:50:39 2014 @@ -90,13 +90,16 @@ hostConfig.deployDescriptor.blocked=The hostConfig.deployDescriptor.error=Error deploying configuration descriptor {0} hostConfig.deployDescriptor.threaded.error=Error waiting for multi-thread deployment of context descriptors to complete hostConfig.deployDescriptor.localDocBaseSpecified=A docBase {0} inside the host appBase has been specified, and will be ignored +hostConfig.deployDescriptor.finished=Deployment of configuration descriptor {0} has finished in {1} ms hostConfig.deployDir=Deploying web application directory {0} hostConfig.deployDir.error=Error deploying web application directory {0} hostConfig.deployDir.threaded.error=Error waiting for multi-thread deployment of directories to complete +hostConfig.deployDir.finished=Deployment of web application directory {0} has finished in {1} ms hostConfig.deployWar=Deploying web application archive {0} hostConfig.deployWar.error=Error deploying web application archive {0} hostConfig.deployWar.hiddenDir=The directory [{0}] will be ignored because the WAR [{1}] takes priority and unpackWARs is false hostConfig.deployWar.threaded.error=Error waiting for multi-thread deployment of WAR files to complete +hostConfig.deployWar.finished=Deployment of web application archive {0} has finished in {1} ms hostConfig.deploy.error=Exception while deploying web application directory {0} hostConfig.deploying=Deploying discovered web applications hostConfig.expand=Expanding web application archive {0} Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589698&r1=1589697&r2=1589698&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Apr 24 12:50:39 2014 @@ -102,6 +102,11 @@ <code>WebappClassLoader</code>. State is now correctly reported rather than always reporting as <code>NEW</code>. (markt) </scode> + <add> + <bug>56382</bug>: Information about finished deployment and its execution + time is added to the log files. Patch is provided by Danila Galimov. + (violetagg) + </add> <fix> <bug>56390</bug>: Fix JAR locking issue with JARs containing TLDs and the TLD cache that prevented the undeployment of web applications when --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org