archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r451590 - in /maven/archiva/trunk: archiva-core/src/main/java/org/apache/maven/archiva/proxy/ archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/
Date Sat, 30 Sep 2006 12:42:12 GMT
Author: brett
Date: Sat Sep 30 05:42:11 2006
New Revision: 451590

URL: http://svn.apache.org/viewvc?view=rev&rev=451590
Log:
[MRM-187] improve proxy logging

Modified:
    maven/archiva/trunk/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java
    maven/archiva/trunk/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java
    maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java

Modified: maven/archiva/trunk/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java?view=diff&rev=451590&r1=451589&r2=451590
==============================================================================
--- maven/archiva/trunk/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java
(original)
+++ maven/archiva/trunk/archiva-core/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyManager.java
Sat Sep 30 05:42:11 2006
@@ -26,6 +26,7 @@
 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 @@
  * @plexus.component instantiation-strategy="per-lookup"
  */
 public class DefaultProxyManager
+    extends AbstractLogEnabled
     implements ProxyManager
 {
     /**
@@ -95,7 +97,9 @@
         }
         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(),

Modified: maven/archiva/trunk/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java?view=diff&rev=451590&r1=451589&r2=451590
==============================================================================
--- maven/archiva/trunk/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java
(original)
+++ maven/archiva/trunk/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java
Sat Sep 30 05:42:11 2006
@@ -143,15 +143,18 @@
                 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 @@
                 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 @@
                 {
                     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 @@
                 {
                     moveTempToTarget( temp, target );
                 }
+
+                getLogger().debug( "Successfully downloaded" );
             }
             //try next repository
         }

Modified: maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java?view=diff&rev=451590&r1=451589&r2=451590
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java
(original)
+++ maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ProxyAction.java
Sat Sep 30 05:42:11 2006
@@ -65,11 +65,13 @@
         }
         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;
         }



Mime
View raw message