From 60b382e36e53e37d966fe79db62618fd34d9c5e1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 2 Dec 2013 04:07:17 +0000 Subject: fix logging warn level git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1546890 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/archiva/rest/services/DefaultBrowseService.java | 4 ++-- .../rest/services/DefaultManagedRepositoriesService.java | 2 +- .../rest/services/DefaultReportRepositoriesService.java | 4 ++-- .../rest/services/ManagedRepositoriesServiceTest.java | 2 +- .../org/apache/archiva/rest/services/SearchServiceTest.java | 12 ++++++------ .../apache/archiva/security/ArchivaServletAuthenticator.java | 4 ++-- .../main/java/org/apache/archiva/web/rss/RssFeedServlet.java | 2 +- .../web/security/ArchivaLockedAdminEnvironmentCheck.java | 2 +- .../src/main/java/org/apache/archiva/web/startup/Banner.java | 2 +- .../apache/archiva/web/startup/SecuritySynchronization.java | 5 ++--- .../apache/archiva/remotedownload/AbstractDownloadTest.java | 2 +- .../apache/archiva/remotedownload/DownloadArtifactsTest.java | 2 +- .../org/apache/archiva/webdav/ArchivaDavResourceFactory.java | 2 +- .../webdav/AbstractRepositoryServletProxiedTestCase.java | 2 +- 14 files changed, 23 insertions(+), 24 deletions(-) (limited to 'archiva-modules/archiva-web') diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index 7fdbf4e92..7055fdea3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -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() ); } } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java index 3c20cdd6b..c43f85047 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java @@ -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 ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java index 0c4fd1edb..bb5deac15 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java @@ -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() ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java index 181514a1d..38e12302b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java @@ -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() ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java index d44461ed4..b08966685 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/SearchServiceTest.java @@ -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 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 artifacts = searchService.searchArtifacts( searchRequest ); - log.info( "artifacts:" + artifacts ); + log.info( "artifacts: {}", artifacts ); assertEquals( 1, artifacts.size() ); deleteTestRepo( testRepoId ); } diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java index 0cbc02fd2..76222885c 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaServletAuthenticator.java @@ -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 ); } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java index a16388301..d230c7ba7 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java @@ -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( "" ) ) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java index db451617c..a6090cec1 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java @@ -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; diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/Banner.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/Banner.java index 3547ee308..e36b7bda0 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/Banner.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/Banner.java @@ -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 ); } } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java index 592b96896..3f4c20909 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java @@ -188,7 +188,7 @@ public class SecuritySynchronization EnvironmentCheck check = entry.getValue(); List v = new ArrayList(); 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 ); } } } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java index 367bc070c..881377931 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java @@ -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" ); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java index aa1be1a3c..c0d491d69 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java @@ -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(); } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index d9d1754e8..9b0f15367 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -629,7 +629,7 @@ public class ArchivaDavResourceFactory } catch ( LayoutException e ) { - log.warn( "Artifact path '" + resourcePath + "' is invalid." ); + log.warn( "Artifact path '{}' is invalid." ,resourcePath ); } } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java index c8aeba0e0..1886e01cc 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java @@ -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 ); -- cgit v1.2.3