diff options
author | Brett Porter <brett@apache.org> | 2006-09-30 12:42:11 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2006-09-30 12:42:11 +0000 |
commit | 28dc3238cbfb87c9c1955cbab401f524a28c5c46 (patch) | |
tree | e5812d35e03397d45b1d1a7491aea0ef431b89d5 | |
parent | 6b21148ea3ac746653eb9eb3715c138faf88b8fb (diff) | |
download | archiva-28dc3238cbfb87c9c1955cbab401f524a28c5c46.tar.gz archiva-28dc3238cbfb87c9c1955cbab401f524a28c5c46.zip |
[MRM-187] improve proxy logging
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@451590 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 17 insertions, 5 deletions
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java b/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java index 9fc69353d..fbd301829 100644 --- a/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java +++ b/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java @@ -26,6 +26,7 @@ import org.apache.maven.archiva.configuration.RepositoryConfiguration; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.proxy.ProxyInfo; +import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.StringUtils; import java.io.File; @@ -44,6 +45,7 @@ import java.util.Map; * @plexus.component instantiation-strategy="per-lookup" */ public class DefaultProxyManager + extends AbstractLogEnabled implements ProxyManager { /** @@ -95,7 +97,9 @@ public class DefaultProxyManager } else { - repositoryPath = repositoryPath.substring( proxyGroup.getManagedRepository().getId().length() + 2 ); + String id = proxyGroup.getManagedRepository().getId(); + getLogger().debug( "requesting " + repositoryPath + " from repository '" + id + "'" ); + repositoryPath = repositoryPath.substring( id.length() + 2 ); } return requestHandler.get( repositoryPath, proxyGroup.getProxiedRepositories(), diff --git a/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java b/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java index 97eff1f8d..0d19c3012 100644 --- a/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java +++ b/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java @@ -143,15 +143,18 @@ public class DefaultProxyRequestHandler artifactPath = path.substring( 0, index ); } + String msg = ""; + // Request for artifact: parse the requested path to build an Artifact. Artifact artifact = null; try { artifact = defaultArtifactDiscoverer.buildArtifact( artifactPath ); + getLogger().debug( "Artifact requested is: " + artifact ); } catch ( DiscovererException e ) { - getLogger().debug( "Failed to build artifact using default layout with message: " + e.getMessage() ); + msg = "Failed to build artifact from path:\n\tfrom default: " + e.getMessage(); } if ( artifact == null ) @@ -159,10 +162,11 @@ public class DefaultProxyRequestHandler try { artifact = legacyArtifactDiscoverer.buildArtifact( artifactPath ); + getLogger().debug( "Artifact requested is: " + artifact ); } catch ( DiscovererException e ) { - getLogger().debug( "Failed to build artifact using legacy layout with message: " + e.getMessage() ); + getLogger().debug( msg + "\n\tfrom legacy: " + e.getMessage() ); } } @@ -500,15 +504,15 @@ public class DefaultProxyRequestHandler { tries++; - getLogger().debug( "Trying " + path + " from " + repository.getName() + "..." ); - boolean downloaded = true; if ( force || !target.exists() ) { + getLogger().debug( "Retrieving " + path + " from " + repository.getName() ); wagon.get( path, temp ); } else { + getLogger().debug( "Retrieving " + path + " from " + repository.getName() + " if updated" ); downloaded = wagon.getIfNewer( path, temp, target.lastModified() ); } @@ -537,6 +541,8 @@ public class DefaultProxyRequestHandler { moveTempToTarget( temp, target ); } + + getLogger().debug( "Successfully downloaded" ); } //try next repository } diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java index 5ae074d6d..b75a2a97a 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java @@ -65,11 +65,13 @@ public class ProxyAction } catch ( ResourceDoesNotExistException e ) { + getLogger().debug( "Requested proxy path not found: " + e.getMessage() ); // TODO: set message? return NOT_FOUND; } catch ( FileNotFoundException e ) { + getLogger().debug( "Requested proxy file not found: " + e.getMessage() ); // TODO: set message? return NOT_FOUND; } |