]> source.dussan.org Git - archiva.git/commitdiff
fix logging warn level
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Dec 2013 04:07:17 +0000 (04:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Dec 2013 04:07:17 +0000 (04:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1546890 13f79535-47bb-0310-9956-ffa450edef68

38 files changed:
archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java
archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java
archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/WagonDelegate.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerBeginScanClosure.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java
archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/Banner.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java
archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/MetadataAuditListener.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemEventListener.java
archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java

index fb7628d0f889ce7b6c194c04c277a275dd819a8d..e6a3d6aa53053e83b562bca71a4568c88a83664a 100644 (file)
@@ -175,7 +175,7 @@ public class ChecksummedFile
             }
             catch ( IOException e )
             {
-                log.warn( "Unable to update checksum:" + e.getMessage() );
+                log.warn( "Unable to update checksum:{}", e.getMessage() );
                 return false;
             }
 
@@ -200,7 +200,7 @@ public class ChecksummedFile
             }
             catch ( IOException e )
             {
-                log.warn( "Unable to read / parse checksum: " + e.getMessage() );
+                log.warn( "Unable to read / parse checksum: {}", e.getMessage() );
                 return false;
             }
 
index 2f5f439fcd77ac6ac76c3df631d124243ea05a7d..87253b01a93cb6aafd8a0099cd657c2cb13ecb7a 100644 (file)
@@ -336,7 +336,7 @@ public class DefaultArchivaConfiguration
                     else
                     {
                         // Policy key doesn't exist. Don't add it to golden version.
-                        log.warn( "Policy [" + policyId + "] does not exist." );
+                        log.warn( "Policy [{}] does not exist.", policyId );
                     }
                 }
 
index b6a678e95c601f5701488000dc3fe9ba7da06618..f9b081f3dabcef70c7eb62ddd48623ed24b58a53 100644 (file)
@@ -568,7 +568,7 @@ public class ArchivaConfigurationTest
         assertEquals( "check managed repositories", "default", repository.getLayout() );
         assertTrue( "check managed repositories", repository.isScanned() );
 
-        log.info( "knowContentConsumers " + configuration.getRepositoryScanning().getKnownContentConsumers() );
+        log.info( "knowContentConsumers {}", configuration.getRepositoryScanning().getKnownContentConsumers() );
 
         assertFalse(
             configuration.getRepositoryScanning().getKnownContentConsumers().contains( "update-db-artifact" ) );
index d7a585ff841d73fd3fee12a3540cef36d3b489ba..12a7d1054ed9598f7b76f03d3970a5cb2597de50 100644 (file)
@@ -206,15 +206,15 @@ public class ArchivaMetadataCreationConsumer
         catch ( MetadataRepositoryException e )
         {
             log.warn(
-                "Error occurred persisting metadata for artifact:{} (repository:{}); message: {}" + e.getMessage(),
-                new Object[]{ path, repoId, e.getMessage() }, e );
+                "Error occurred persisting metadata for artifact:{} (repository:{}); message: {}" ,
+                path, repoId, e.getMessage(), e );
             repositorySession.revert();
         }
         catch ( RepositoryStorageRuntimeException e )
         {
             log.warn(
-                "Error occurred persisting metadata for artifact:{} (repository:{}); message: {}" + e.getMessage(),
-                new Object[]{ path, repoId, e.getMessage() }, e );
+                "Error occurred persisting metadata for artifact:{} (repository:{}); message: {}",
+                path, repoId, e.getMessage(), e );
             repositorySession.revert();
         }
         finally
index a586c2b8f9788e94a3bb45ee880247ce1b65286e..8d1d93ebda4dde5b2f813748ee6b4a6239aeb6fe 100644 (file)
@@ -134,11 +134,11 @@ public class LegacyConverterArtifactConsumer
         }
         catch ( LayoutException e )
         {
-            log.warn( "Unable to convert artifact: " + path + " : " + e.getMessage(), e );
+            log.warn( "Unable to convert artifact: {} : {}",path , e.getMessage(), e );
         }
         catch ( ArtifactConversionException e )
         {
-            log.warn( "Unable to convert artifact: " + path + " : " + e.getMessage(), e );
+            log.warn( "Unable to convert artifact: {} : {}",path , e.getMessage(), e );
         }
     }
 
index c80700fdd09806ad0bda069900de7e6ecff7e4f6..7ab8375da19307a387129730d7ec28ce055efbb3 100644 (file)
@@ -828,7 +828,7 @@ public class MavenRepositorySearchTest
 
         archivaConfigControl.verify();
 
-        log.info( "groupIds: " + groupIds );
+        log.info( "groupIds: {}", groupIds );
 
         assertEquals( 3, groupIds.size() );
         assertTrue( groupIds.contains( "com" ) );
index 50e9d616cc4ad0bf30d47868dcee64b2827fc025..da58f1c406e3f0a1763df332b55218f6cde78fd7 100755 (executable)
@@ -110,7 +110,7 @@ public class DefaultWagonFactory
         }
         catch ( Exception e )
         {
-            logger.warn( "fail to configure User-Agent: " + e.getMessage(), e );
+            logger.warn( "fail to configure User-Agent: {}", e.getMessage(), e );
         }
     }
 }
index 687a2d1c7205ee8c1e30cc5baae6b93f761eeb9f..3bdfab01a8b67758ad1686d5f70b9efa65c22237 100644 (file)
@@ -268,11 +268,11 @@ public class DefaultRepositoryProxyConnectors
             }
             catch ( RepositoryNotFoundException e )
             {
-                log.warn( "Unable to use proxy connector: " + e.getMessage(), e );
+                log.warn( "Unable to use proxy connector: {}", e.getMessage(), e );
             }
             catch ( RepositoryException e )
             {
-                log.warn( "Unable to use proxy connector: " + e.getMessage(), e );
+                log.warn( "Unable to use proxy connector: {}", e.getMessage(), e );
             }
 
 
@@ -447,8 +447,8 @@ public class DefaultRepositoryProxyConnectors
             catch ( ProxyException e )
             {
                 log.warn(
-                    "Transfer error from repository \"" + targetRepository.getRepository().getId() + "\" for resource "
-                        + path + ", continuing to next repository. Error message: {}", e.getMessage() );
+                    "Transfer error from repository {} for resource {}, continuing to next repository. Error message: {}",
+                    targetRepository.getRepository().getId(), path, e.getMessage() );
                 log.debug( MarkerFactory.getDetachedMarker( "transfer.error" ),
                            "Transfer error from repository \"" + targetRepository.getRepository().getId()
                                + "\" for resource " + path + ", continuing to next repository. Error message: {}",
@@ -457,8 +457,7 @@ public class DefaultRepositoryProxyConnectors
             catch ( RepositoryAdminException e )
             {
                 log.debug( MarkerFactory.getDetachedMarker( "transfer.error" ),
-                           "Transfer error from repository \"" + targetRepository.getRepository().getId()
-                               + "\" for resource " + path + ", continuing to next repository. Error message: {}",
+                           "Transfer error from repository {} for resource {}, continuing to next repository. Error message: {}",targetRepository.getRepository().getId(), path,
                            e.getMessage(), e );
                 log.debug( MarkerFactory.getDetachedMarker( "transfer.error" ), "Full stack trace", e );
             }
@@ -517,16 +516,14 @@ public class DefaultRepositoryProxyConnectors
             }
             catch ( ProxyException e )
             {
-                log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId()
-                              + "\" for versioned Metadata " + logicalPath
-                              + ", continuing to next repository. Error message: " + e.getMessage() );
+                log.warn( "Transfer error from repository {} for versioned Metadata {}, continuing to next repository. Error message: {}",
+                          targetRepository.getRepository().getId(), logicalPath, e.getMessage() );
                 log.debug( "Full stack trace", e );
             }
             catch ( RepositoryAdminException e )
             {
-                log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId()
-                              + "\" for versioned Metadata " + logicalPath
-                              + ", continuing to next repository. Error message: " + e.getMessage() );
+                log.warn( "Transfer error from repository {} for versioned Metadata {}, continuing to next repository. Error message: {}",
+                          targetRepository.getRepository().getId(), logicalPath, e.getMessage() );
                 log.debug( "Full stack trace", e );
             }
         }
@@ -544,7 +541,7 @@ public class DefaultRepositoryProxyConnectors
             }
             catch ( RepositoryMetadataException e )
             {
-                log.warn( "Unable to update metadata " + localFile.getAbsolutePath() + ": " + e.getMessage(), e );
+                log.warn( "Unable to update metadata {}:{}", localFile.getAbsolutePath(), e.getMessage(), e );
             }
         }
 
@@ -928,7 +925,7 @@ public class DefaultRepositoryProxyConnectors
         catch ( ProxyException e )
         {
             urlFailureCache.cacheFailure( url );
-            log.warn( "Transfer failed on checksum: " + url + " : " + e.getMessage(), e );
+            log.warn( "Transfer failed on checksum: {} : {}",url ,e.getMessage(), e );
             // Critical issue, pass it on.
             throw e;
         }
@@ -1088,8 +1085,8 @@ public class DefaultRepositoryProxyConnectors
         }
 
         log.warn(
-            "Transfer error from repository \"" + content.getRepository().getId() + "\" for artifact " + Keys.toKey(
-                artifact ) + ", continuing to next repository. Error message: " + exception.getMessage() );
+            "Transfer error from repository {} for artifact {} , continuing to next repository. Error message: {}",
+            content.getRepository().getId(), Keys.toKey( artifact), exception.getMessage() );
         log.debug( "Full stack trace", exception );
     }
 
@@ -1214,12 +1211,12 @@ public class DefaultRepositoryProxyConnectors
         }
         catch ( ConnectionException e )
         {
-            log.warn( "Could not connect to " + remoteRepository.getRepository().getName() + ": " + e.getMessage() );
+            log.warn( "Could not connect to {}: {}", remoteRepository.getRepository().getName(),  e.getMessage() );
             connected = false;
         }
         catch ( AuthenticationException e )
         {
-            log.warn( "Could not connect to " + remoteRepository.getRepository().getName() + ": " + e.getMessage() );
+            log.warn( "Could not connect to {}: {}", remoteRepository.getRepository().getName(),  e.getMessage() );
             connected = false;
         }
 
index 991b57135fb755f460bffe1762803f24e0fd677f..e3f39d2ecaa75cee855b2305a8dfeeb515dcdbc9 100644 (file)
@@ -213,7 +213,7 @@ public abstract class AbstractProxyTestCase
 
         CacheManager.getInstance().clearAll();
 
-        log.info( "\n.\\ " + name + "() \\._________________________________________\n" );
+        log.info( "\n.\\ {}() \\._________________________________________\n", name );
     }
 
     @After
index dea5ad5b3dd0a51e2277fe690234fb6953caeb17..71cd32262e2f39af507ff9e209efe69fbbe6afe3 100644 (file)
@@ -65,7 +65,7 @@ public class WagonDelegate
     public boolean getIfNewer( String resourceName, File destination, long timestamp )
         throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
     {
-        log.info( ".getIfNewer(" + resourceName + ", " + destination + ", " + timestamp + ")" );
+        log.info( ".getIfNewer({}, {}, {})", resourceName, destination, timestamp );
 
         boolean result = delegate.getIfNewer( resourceName, destination, timestamp );
         createIfMissing( destination );
index 9b1007820f9393742b57a0526e7394663a485dda..4d0ea216ff033c73f9c6a0e09a38c8ea9be30f2b 100644 (file)
@@ -389,7 +389,7 @@ public class DefaultManagedRepositoryAdmin
             catch ( MetadataRepositoryException e )
             {
                 //throw new RepositoryAdminException( e.getMessage(), e );
-                log.warn( "skip error during removing repository from MetadatRepository:" + e.getMessage(), e );
+                log.warn( "skip error during removing repository from MetadatRepository:{}", e.getMessage(), e );
             }
             finally
             {
index 746a57f8b94c456d1f1eb279290dbde856aaf586..4f73fa96078d39751d44b6a1501755d5a66a15ca 100644 (file)
@@ -48,7 +48,7 @@ public class ManagedRepositoryAdminTest
         List<ManagedRepository> repos = managedRepositoryAdmin.getManagedRepositories();
         assertNotNull( repos );
         assertTrue( repos.size() > 0 );
-        log.info( "repos " + repos );
+        log.info( "repos {}", repos );
 
         // check default internal
         ManagedRepository internal = findManagedRepoById( repos, "internal" );
index db52d6445f1d1de20a6d319428786129e0c8178c..cf062996f1c4b46a7874c93799c959b5bd3a600f 100644 (file)
@@ -39,7 +39,7 @@ public class RemoteRepositoryAdminTest
         List<RemoteRepository> remoteRepositories = remoteRepositoryAdmin.getRemoteRepositories();
         assertNotNull( remoteRepositories );
         assertTrue( remoteRepositories.size() > 0 );
-        log.info( "remote " + remoteRepositories );
+        log.info( "remote {}", remoteRepositories );
     }
 
     @Test
index c2bcd9a06d4df2e17a077de882e6175f24485cef..157aeaad34150055067eecd4fbf4a2c0544ed022 100644 (file)
@@ -376,7 +376,7 @@ public class MetadataTools
         {
             // TODO: [monitor] consider a monitor for this event.
             // TODO: consider a read-redo on monitor return code?
-            log.warn( "Unable to read metadata: " + metadataFile.getAbsolutePath(), e );
+            log.warn( "Unable to read metadata: {}", metadataFile.getAbsolutePath(), e );
             return null;
         }
     }
@@ -401,7 +401,7 @@ public class MetadataTools
         {
             // TODO: [monitor] consider a monitor for this event.
             // TODO: consider a read-redo on monitor return code?
-            log.warn( "Unable to read metadata: " + metadataFile.getAbsolutePath(), e );
+            log.warn( "Unable to read metadata: {}", metadataFile.getAbsolutePath(), e );
             return null;
         }
     }
@@ -426,7 +426,7 @@ public class MetadataTools
         {
             // TODO: [monitor] consider a monitor for this event.
             // TODO: consider a read-redo on monitor return code?
-            log.warn( "Unable to read metadata: " + metadataFile.getAbsolutePath(), e );
+            log.warn( "Unable to read metadata: {}", metadataFile.getAbsolutePath(), e );
             return null;
         }
     }
index dbc1453b5a929d3f917023551f541f3cdfb4b217..5c1e66e4e06893ef6079699dc0ee6386a2bb8e07 100644 (file)
@@ -73,7 +73,7 @@ public class TriggerBeginScanClosure
             }
             catch ( ConsumerException e )
             {
-                log.warn( "Consumer [" + consumer.getId() + "] cannot begin: " + e.getMessage(), e );
+                log.warn( "Consumer [{}] cannot begin: {}",consumer.getId(), e.getMessage(), e );
             }
         }
     }
index b4c2a633d3a69e1025f68614fd2d780a61478ace..05f51d57a4e8bb5aa7f3247b6d92302f0e4540b3 100644 (file)
@@ -205,7 +205,7 @@ public class DefaultDownloadRemoteIndexScheduler
                 }
                 catch ( IllegalArgumentException e )
                 {
-                    log.warn( "Unable to schedule remote index download: " + e.getLocalizedMessage() );
+                    log.warn( "Unable to schedule remote index download: {}", e.getLocalizedMessage() );
                 }
 
                 if ( remoteRepository.isDownloadRemoteIndexOnStartup() )
index d01629b434ba189af795a6ec84855683d44b75d2..c87617880a5aa973b139dd975b03f6be649da912 100644 (file)
@@ -229,7 +229,7 @@ public class DownloadRemoteIndexTask
             deleteDirectoryQuiet( tempIndexDirectory );
             this.runningRemoteDownloadIds.remove( this.remoteRepository.getId() );
         }
-        log.info( "end download remote index for remote repository " + this.remoteRepository.getId() );
+        log.info( "end download remote index for remote repository {}", this.remoteRepository.getId() );
     }
 
     private void deleteDirectoryQuiet( File f )
index f5956e542f46c571620b44f36c7c11ad99b5c032..104fa522f53e4787292243ef20ffc71d6ddc71f1 100644 (file)
@@ -88,7 +88,7 @@ public class DownloadRemoteIndexTaskTest
         this.server.start();
         Connector connector = this.server.getConnectors()[0];
         this.port = connector.getLocalPort();
-        log.info( "start server on port " + this.port );
+        log.info( "start server on port {}", this.port );
         nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
     }
 
@@ -140,7 +140,7 @@ public class DownloadRemoteIndexTaskTest
 
         FlatSearchResponse response = nexusIndexer.searchFlat( rq );
 
-        log.info( "returned hit count:" + response.getReturnedHitsCount() );
+        log.info( "returned hit count:{}", response.getReturnedHitsCount() );
         assertEquals( 8, response.getReturnedHitsCount() );
     }
 
index 7fdbf4e929c705686bbadac2cd51d2e446b43e87..7055fdea3911747ab243cbde0563e87482919d5a 100644 (file)
@@ -281,8 +281,8 @@ public class DefaultBrowseService
                     catch ( MetadataResolutionException e )
                     {
                         log.warn(
-                            "Skipping invalid metadata while compiling shared model for " + groupId + ":" + artifactId
-                                + " in repo " + repoId + ": " + e.getMessage() );
+                            "Skipping invalid metadata while compiling shared model for {}:{} in repo {}: {}",
+                            groupId, artifactId, repoId, e.getMessage() );
                     }
                 }
             }
index 3c20cdd6bee49c4372e3d1ee7d5f7967993b4c1f..c43f850479a2045062646bdda4668aa7729e20f0 100644 (file)
@@ -165,7 +165,7 @@ public class DefaultManagedRepositoriesService
             }
             catch ( MetadataRepositoryException e )
             {
-                log.warn( "Error retrieving repository statistics: " + e.getMessage(), e );
+                log.warn( "Error retrieving repository statistics: {}", e.getMessage(), e );
             }
             if ( stats != null )
             {
index 0c4fd1edb1b15a101e59dca16bbb9a05b2a155d8..bb5deac15262a0c8b091766e60e263e0f1d9eb10 100644 (file)
@@ -82,7 +82,7 @@ public class DefaultReportRepositoriesService
                 }
                 catch ( MetadataRepositoryException e )
                 {
-                    log.warn( "Unable to retrieve stats, assuming is empty: " + e.getMessage(), e );
+                    log.warn( "Unable to retrieve stats, assuming is empty: {}", e.getMessage(), e );
                 }
             }
 
@@ -109,7 +109,7 @@ public class DefaultReportRepositoriesService
             }
             catch ( MetadataRepositoryException e )
             {
-                log.warn( "Unable to retrieve stats, assuming is empty: " + e.getMessage(), e );
+                log.warn( "Unable to retrieve stats, assuming is empty: {}", e.getMessage(), e );
             }
             if ( stats == null || stats.isEmpty() )
             {
index 181514a1d23ab60aa7351b79e8f4e0f0df679d5d..38e12302b6b58470148a1465d70311bcb49f6ba1 100644 (file)
@@ -160,7 +160,7 @@ public class ManagedRepositoriesServiceTest
 
         assertNotNull( archivaRepositoryStatistics );
 
-        log.info( "archivaRepositoryStatistics:" + archivaRepositoryStatistics.toString() );
+        log.info( "archivaRepositoryStatistics: {}", archivaRepositoryStatistics.toString() );
 
         assertEquals( 92, archivaRepositoryStatistics.getNewFileCount() );
         assertEquals( 92, archivaRepositoryStatistics.getTotalFileCount() );
index d44461ed41981869b920cd6e04559e035aaa17b7..b08966685bca9ec285fec912e3303fcccebf017d 100644 (file)
@@ -130,7 +130,7 @@ public class SearchServiceTest
 
         for ( Artifact artifact : artifacts )
         {
-            log.info( "url:" + artifact.getUrl() );
+            log.info( "url: {}", artifact.getUrl() );
             String version = artifact.getVersion();
             assertTrue( artifact.getUrl().contains( version ) );
 
@@ -231,7 +231,7 @@ public class SearchServiceTest
 
         for ( Artifact artifact : artifacts )
         {
-            log.info( "url:" + artifact.getUrl() );
+            log.info( "url: {}", artifact.getUrl() );
             String version = artifact.getVersion();
             assertEquals( "http://localhost:" + port
                               + "/repository/test-repo/org/apache/karaf/features/org.apache.karaf.features.core/"
@@ -269,7 +269,7 @@ public class SearchServiceTest
         assertTrue( " not 1 results for Bundle ExportPackage org.apache.karaf.features.command.completers but "
                         + artifacts.size() + ":" + artifacts, artifacts.size() == 1 );
 
-        log.info( "artifact url " + artifacts.get( 0 ).getUrl() );
+        log.info( "artifact url {}", artifacts.get( 0 ).getUrl() );
         deleteTestRepo( testRepoId );
     }
 
@@ -333,7 +333,7 @@ public class SearchServiceTest
         assertTrue( " not 0 results for Bundle ExportPackage org.apache.karaf.features.command.completers but "
                         + artifacts.size() + ":" + artifacts, artifacts.size() == 1 );
 
-        log.info( "artifact url " + artifacts.get( 0 ).getUrl() );
+        log.info( "artifact url {}", artifacts.get( 0 ).getUrl() );
         deleteTestRepo( testRepoId );
     }
 
@@ -354,7 +354,7 @@ public class SearchServiceTest
         SearchService searchService = getSearchService( authorizationHeader );
 
         Collection<String> groupIds = searchService.getAllGroupIds( Arrays.asList( testRepoId ) ).getGroupIds();
-        log.info( "groupIds  " + groupIds );
+        log.info( "groupIds  {}", groupIds );
         assertFalse( groupIds.isEmpty() );
         assertTrue( groupIds.contains( "commons-cli" ) );
         assertTrue( groupIds.contains( "org.apache.felix" ) );
@@ -384,7 +384,7 @@ public class SearchServiceTest
             new SearchRequest( "org.foo", "studio-all-update-site", null, null, null, Arrays.asList( "test-repo" ) );
 
         List<Artifact> artifacts = searchService.searchArtifacts( searchRequest );
-        log.info( "artifacts:" + artifacts );
+        log.info( "artifacts: {}", artifacts );
         assertEquals( 1, artifacts.size() );
         deleteTestRepo( testRepoId );
     }
index 0cbc02fd2d64edae92f3009caf740d0887dfae02..76222885c5e8b6081e448e6dc679c3c46d389f85 100644 (file)
@@ -77,8 +77,8 @@ public class ArchivaServletAuthenticator
         {
             if ( authzResult.getException() != null )
             {
-                log.info( "Authorization Denied [ip=" + request.getRemoteAddr() + ",permission=" + permission + ",repo="
-                              + repositoryId + "] : " + authzResult.getException().getMessage() );
+                log.info( "Authorization Denied [ip={},permission={},repo={}] : {}", request.getRemoteAddr(),
+                          permission, repositoryId, authzResult.getException().getMessage() );
 
                 throw new UnauthorizedException( "Access denied for repository " + repositoryId );
             }
index a16388301bde686caf031abc91dbc503b264cfd8..d230c7ba7377a874e95c8d2c730b1d04affc9e20 100644 (file)
@@ -263,7 +263,7 @@ public class RssFeedServlet
                 }
                 catch ( DecoderException ie )
                 {
-                    log.warn( "Error decoding username and password.", ie.getMessage() );
+                    log.warn( "Error decoding username and password: {}", ie.getMessage() );
                 }
 
                 if ( usernamePassword == null || usernamePassword.trim().equals( "" ) )
index db451617c667a523c2ba0f7042549ceeceda30f6..a6090cec1a10b6f0651a42e80eebf4e92cd0a590 100644 (file)
@@ -134,7 +134,7 @@ public class ArchivaLockedAdminEnvironmentCheck
                 }
                 catch ( RbacManagerException e )
                 {
-                    log.warn( "Exception when checking for locked admin user: " + e.getMessage(), e );
+                    log.warn( "Exception when checking for locked admin user: {}", e.getMessage(), e );
                 }
 
                 checked = true;
index 3547ee308e509c9d32f1fdf0cb43b070a59c76c8..e36b7bda031c372fddeda6418ec9c134478cedf0 100644 (file)
@@ -224,6 +224,6 @@ public class Banner
     public static void display( String version )
     {
         String banner = getBanner( version );
-        LoggerFactory.getLogger( Banner.class ).info( StringUtils.repeat( "_", 25 ) + eol + banner );
+        LoggerFactory.getLogger( Banner.class ).info( "{} {}, {}" , StringUtils.repeat( "_", 25 ), eol, banner );
     }
 }
index 592b96896d4efd093543f45d320f7170c9e81ecf..3f4c20909371be7d4a8168898d896b36ff3d94d9 100644 (file)
@@ -188,7 +188,7 @@ public class SecuritySynchronization
             EnvironmentCheck check = entry.getValue();
             List<String> v = new ArrayList<String>();
             check.validateEnvironment( v );
-            log.info( "Environment Check: " + entry.getKey() + " -> " + v.size() + " violation(s)" );
+            log.info( "Environment Check: {} -> {} violation(s)", entry.getKey(), v.size() );
             for ( String s : v )
             {
                 violations.add( "[" + entry.getKey() + "] " + s );
@@ -247,8 +247,7 @@ public class SecuritySynchronization
             }
             catch ( RbacManagerException e )
             {
-                log.warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) + "] to "
-                              + principal + " user.", e );
+                log.warn( "Unable to add role [{}] to {} user.", ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ), principal, e );
             }
         }
     }
index 367bc070c26b0759567b8a6e53b3dd2e8b3d2692..88137793174dc98d57a2a5f8e961e18c5cc2b501 100644 (file)
@@ -128,7 +128,7 @@ public abstract class AbstractDownloadTest
         this.server.start();
         Connector connector = this.server.getConnectors()[0];
         this.port = connector.getLocalPort();
-        log.info( "start server on port " + this.port );
+        log.info( "start server on port {}", this.port );
 
         User user = new User();
         user.setEmail( "toto@toto.fr" );
index aa1be1a3cc6decfd794fb683678029c543b0b423..c0d491d69fc3e89bd823175174be6f5484a70fdc 100644 (file)
@@ -197,7 +197,7 @@ public class DownloadArtifactsTest
         }
         catch ( Throwable e )
         {
-            log.info( "fail to get zipEntries " + e.getMessage(), e );
+            log.info( "fail to get zipEntries {}", e.getMessage(), e );
         }
         return Collections.emptyList();
     }
index d9d1754e87a5289a078db181abb90c8482fe93e8..9b0f1536701ddcc0a7b26433959836a93048c38c 100644 (file)
@@ -629,7 +629,7 @@ public class ArchivaDavResourceFactory
                     }
                     catch ( LayoutException e )
                     {
-                        log.warn( "Artifact path '" + resourcePath + "' is invalid." );
+                        log.warn( "Artifact path '{}' is invalid." ,resourcePath );
                     }
                 }
 
index c8aeba0e03349a247ead644b00f855c55a873e08..1886e01cc01baf7096579c97e70cadf23089534a 100644 (file)
@@ -150,7 +150,7 @@ public abstract class AbstractRepositoryServletProxiedTestCase
 
         int port = repo.server.getConnectors()[0].getLocalPort();
         repo.url = "http://localhost:" + port + repo.context;
-        log.info( "Remote HTTP Server started on " + repo.url );
+        log.info( "Remote HTTP Server started on {}", repo.url );
 
         repo.config = createRemoteRepository( repo.id, "Testable [" + repo.id + "] Remote Repo", repo.url );
 
index 2a35f7dcb3a4e5d777858bccc399968836e7e94b..d43bed6a6f00fe1cbfc8f17b5953dc32fde9d96a 100644 (file)
@@ -126,7 +126,7 @@ public class DefaultMetadataResolver
                 }
                 catch ( MetadataRepositoryException e )
                 {
-                    log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
+                    log.warn( "Unable to persist resolved information: {}", e.getMessage(), e );
                 }
 
                 session.markDirty();
@@ -193,7 +193,7 @@ public class DefaultMetadataResolver
                     }
                     catch ( MetadataRepositoryException e )
                     {
-                        log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
+                        log.warn( "Unable to persist resolved information: {}", e.getMessage(), e );
                     }
                 }
                 session.markDirty();
@@ -233,7 +233,7 @@ public class DefaultMetadataResolver
                     }
                     catch ( MetadataRepositoryException e )
                     {
-                        log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
+                        log.warn( "Unable to persist resolved information: {}", e.getMessage(), e );
                     }
                 }
                 session.markDirty();
@@ -276,7 +276,7 @@ public class DefaultMetadataResolver
                         }
                         catch ( MetadataRepositoryException e )
                         {
-                            log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
+                            log.warn( "Unable to persist resolved information: {}", e.getMessage(), e );
                         }
                     }
                 }
@@ -327,13 +327,13 @@ public class DefaultMetadataResolver
                     }
                     catch ( MetadataRepositoryException e )
                     {
-                        log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
+                        log.warn( "Unable to persist resolved information: {}", e.getMessage(), e );
                     }
                     catch ( RepositoryStorageMetadataInvalidException e )
                     {
                         log.warn(
-                            "Not update project in metadata repository due to an error resolving it from storage: "
-                                + e.getMessage() );
+                            "Not update project in metadata repository due to an error resolving it from storage: {}",
+                                 e.getMessage() );
 
                         for ( RepositoryListener listener : listeners )
                         {
@@ -391,7 +391,7 @@ public class DefaultMetadataResolver
                     }
                     catch ( MetadataRepositoryException e )
                     {
-                        log.warn( "Unable to persist resolved information: " + e.getMessage(), e );
+                        log.warn( "Unable to persist resolved information: {}", e.getMessage(), e );
                     }
                 }
                 session.markDirty();
index cbbb84484fdc62c26df0d791970843b28db0de06..49bd8839c7c88669e224cc75bef4e481eab75b9d 100644 (file)
@@ -64,7 +64,7 @@ public class MetadataAuditListener
             }
             catch ( MetadataRepositoryException e )
             {
-                log.warn( "Unable to write audit event to repository: " + e.getMessage(), e );
+                log.warn( "Unable to write audit event to repository: {}", e.getMessage(), e );
             }
             finally
             {
index 861b57853b2b982b62fece0fbbc9eca499ebc4fa..48271dbf57e36d8939d33cc9b86034e3e6c62d75 100644 (file)
@@ -211,7 +211,7 @@ public class Maven2RepositoryStorage
                 catch ( XMLException e )
                 {
                     // unable to parse metadata - log it, and continue with the version as the original SNAPSHOT version
-                    log.warn( "Invalid metadata: " + metadataFile + " - " + e.getMessage() );
+                    log.warn( "Invalid metadata: {} - {}", metadataFile, e.getMessage() );
                 }
             }
 
@@ -290,8 +290,8 @@ public class Maven2RepositoryStorage
                     if ( ( problem.getException() instanceof FileNotFoundException && e.getModelId() != null &&
                         !e.getModelId().equals( problem.getModelId() ) ) )
                     {
-                        log.warn( "The artifact's parent POM file '" + file + "' cannot be resolved. " +
-                                      "Using defaults for project version metadata.." );
+                        log.warn( "The artifact's parent POM file '{}' cannot be resolved. " +
+                                      "Using defaults for project version metadata..", file );
 
                         ProjectVersionMetadata metadata = new ProjectVersionMetadata();
                         metadata.setId( readMetadataRequest.getProjectVersion() );
index 08aacd166f40a0367f653e2096beaeb5d0bc740f..696eb53d7ca477c0a282a96436fcbc7d8762b85a 100644 (file)
@@ -142,13 +142,13 @@ public class RepositoryModelResolver
                 {
                     log.info(
                         "An exception was caught while attempting to retrieve model '{}' from remote repository '{}'.Reason:{}",
-                        new Object[]{ model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() } );
+                        model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() );
                 }
                 catch ( Exception e )
                 {
                     log.warn(
                         "An exception was caught while attempting to retrieve model '{}' from remote repository '{}'.Reason:{}",
-                        new Object[]{ model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() } );
+                        model.getAbsolutePath(), remoteRepository.getId(), e.getMessage() );
 
                     continue;
                 }
index 825b2573db1ac62923377c9df226c5f8d09357e7..181b0fa9608c29eed897c6c83b0df48cd60a9095 100644 (file)
@@ -51,7 +51,7 @@ public class RepositoryProblemEventListener
         }
         catch ( MetadataRepositoryException e )
         {
-            log.warn( "Unable to remove metadata facet as part of delete event: " + e.getMessage(), e );
+            log.warn( "Unable to remove metadata facet as part of delete event: {}", e.getMessage(), e );
         }
     }
 
@@ -69,8 +69,8 @@ public class RepositoryProblemEventListener
         }
         catch ( MetadataRepositoryException e )
         {
-            log.warn( "Unable to remove repository problem facets for the version being corrected in the repository: "
-                          e.getMessage(), e );
+            log.warn( "Unable to remove repository problem facets for the version being corrected in the repository: {}",
+                          e.getMessage(), e );
         }
     }
 
@@ -92,7 +92,7 @@ public class RepositoryProblemEventListener
         }
         catch ( MetadataRepositoryException e )
         {
-            log.warn( "Unable to add repository problem facets for the version being removed: " + e.getMessage(), e );
+            log.warn( "Unable to add repository problem facets for the version being removed: {}", e.getMessage(), e );
         }
     }
 
index c1007aca9009c3faf1aa93a078f2db35c0d2db5a..e2ec3bd823821ef61744d574298d477354d1a102 100644 (file)
@@ -178,7 +178,7 @@ public class DuplicateArtifactsConsumer
             }
             catch ( Exception e )
             {
-                log.warn( "Not reporting problem for invalid artifact in checksum check: " + e.getMessage() );
+                log.warn( "Not reporting problem for invalid artifact in checksum check: {}", e.getMessage() );
                 return;
             }