From: <fg...@us...> - 2008-09-18 12:38:41
|
Revision: 920 http://openutils.svn.sourceforge.net/openutils/?rev=920&view=rev Author: fgiust Date: 2008-09-18 19:38:50 +0000 (Thu, 18 Sep 2008) Log Message: ----------- minor changes to DeploymentResolver Modified Paths: -------------- trunk/openutils-deployment/pom.xml trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java trunk/openutils-deployment/src/site/changes/changes.xml Modified: trunk/openutils-deployment/pom.xml =================================================================== --- trunk/openutils-deployment/pom.xml 2008-09-17 17:17:04 UTC (rev 919) +++ trunk/openutils-deployment/pom.xml 2008-09-18 19:38:50 UTC (rev 920) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -43,12 +44,12 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> + <version>1.5.3</version> </dependency> <dependency> <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.3</version> + <artifactId>jcl-over-slf4j</artifactId> + <version>1.5.3</version> </dependency> <dependency> <groupId>javax.servlet</groupId> Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-09-17 17:17:04 UTC (rev 919) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/log4j/DeploymentResolver.java 2008-09-18 19:38:50 UTC (rev 920) @@ -25,6 +25,8 @@ import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -34,6 +36,11 @@ public class DeploymentResolver { + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(DeploymentResolver.class); + public static File resolveServerRelativeLocation(ServletContext context, String commaSeparatedListOfPaths) throws FileNotFoundException { @@ -41,9 +48,11 @@ String servername = resolveServerName(); - String rootPath = StringUtils.replace(context.getRealPath("/"), "\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ + String rootPath = StringUtils.stripEnd(StringUtils.replace(context.getRealPath("/"), "\\", "/"), "/"); //$NON-NLS-1$ //$NON-NLS-2$ String webapp = StringUtils.substringAfterLast(rootPath, "/"); //$NON-NLS-1$ + log.info("Resolving log configuration using servername={} and webapp={}", servername, webapp); + for (int j = 0; j < propertiesLocation.length; j++) { String location = StringUtils.trim(propertiesLocation[j]); @@ -54,9 +63,12 @@ if (!initFile.exists() || initFile.isDirectory()) { + log.debug("Log4j config not found at {}", initFile.getAbsolutePath()); continue; } + log.debug("Log4j config FOUND at {}", initFile.getAbsolutePath()); + return initFile; } @@ -65,7 +77,7 @@ MessageFormat .format( "No configuration found using location list {0}. [servername] is [{1}], [webapp] is [{2}] and base path is [{3}]", //$NON-NLS-1$ - new Object[]{ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath})); + new Object[]{ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath })); } Modified: trunk/openutils-deployment/src/site/changes/changes.xml =================================================================== --- trunk/openutils-deployment/src/site/changes/changes.xml 2008-09-17 17:17:04 UTC (rev 919) +++ trunk/openutils-deployment/src/site/changes/changes.xml 2008-09-18 19:38:50 UTC (rev 920) @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- + <!-- "type" attribute can be: add, remove, update or fix. --> <document> @@ -8,11 +8,15 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> + <release version="2.0.2" date="2008-09-18" description=""> + <action type="fix" dev="fgiust"> Added debug logs to DeploymentResolver, and solved resolution of webapp root when + the root real path returned by the container ends with "/".</action> + <action type="update" dev="fgiust"> Update slf4j dependencies to 1.5.3.</action> + </release> <release version="2.0.1" date="2008-02-11" description="2.0.1"> - <action type="fix" dev="fgiust"> - Better handling of classpath resources in it.openutils.deployment.spring.EnvironmentPropertyConfigurer - (resources with "classpath:" prefix were not loaded properly in a web application). - </action> + <action type="fix" dev="fgiust"> Better handling of classpath resources in + it.openutils.deployment.spring.EnvironmentPropertyConfigurer (resources with "classpath:" prefix were not loaded + properly in a web application).</action> </release> </body> </document> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |