Skip to content

Commit 5879c9d

Browse files
committed
#119 Quieting down Jersey logging
1 parent 3cd7636 commit 5879c9d

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
}
66
}
77
dependencies {
8-
classpath "com.gradle.publish:plugin-publish-plugin:0.9.2"
8+
classpath "com.gradle.publish:plugin-publish-plugin:0.9.5"
99
}
1010
}
1111

@@ -81,11 +81,11 @@ pluginBundle {
8181
displayName = 'ml-gradle for MarkLogic'
8282
description = 'Gradle plugin for configuring and deploying applications to MarkLogic'
8383
tags = ['marklogic']
84-
version = "2.3.0"
84+
version = "2.3.1"
8585
}
8686
}
8787

8888
mavenCoordinates {
89-
version = "2.3.0"
89+
version = "2.3.1"
9090
}
9191
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
group=com.marklogic
2-
version=2.3.0
2+
version=2.3.1
33
mlAppDeployerDependency=com.marklogic:ml-app-deployer:2.3.0
44

src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.marklogic.gradle
22

33
import com.marklogic.appdeployer.command.forests.DeployCustomForestsCommand
44
import com.marklogic.gradle.task.forests.DeployCustomForestsTask
5+
import com.sun.jersey.core.spi.component.ProviderServices
56
import org.gradle.api.Plugin
67
import org.gradle.api.Project
78
import org.slf4j.LoggerFactory
@@ -114,13 +115,18 @@ import com.marklogic.mgmt.admin.AdminConfig
114115
import com.marklogic.mgmt.admin.AdminManager
115116
import com.marklogic.mgmt.admin.DefaultAdminConfigFactory
116117

118+
import java.util.logging.Level
119+
import java.util.logging.Logger
120+
117121
class MarkLogicPlugin implements Plugin<Project> {
118122

119123
org.slf4j.Logger logger = LoggerFactory.getLogger(getClass())
120124

121125
void apply(Project project) {
122126
logger.info("\nInitializing ml-gradle")
123127

128+
quietDownJerseyLogging()
129+
124130
// Initialize groovysh support first so it doesn't pick up all the properties added when the AppDeployer is initialized
125131
initializeGroovyShellSupport(project)
126132
initializeAppDeployerObjects(project)
@@ -421,4 +427,16 @@ class MarkLogicPlugin implements Plugin<Project> {
421427
deployer.setCommands(commands)
422428
return deployer
423429
}
430+
431+
/**
432+
* When the MarkLogic DatabaseClient class is used in Gradle, the Jersey ProviderServices class spits out
433+
* a lot of not helpful logging at the INFO level. So we bump it down to WARNING to avoid that.
434+
*/
435+
void quietDownJerseyLogging() {
436+
try {
437+
Logger.getLogger(ProviderServices.class.getName()).setLevel(Level.WARNING)
438+
} catch (Exception e) {
439+
// Ignore, not important
440+
}
441+
}
424442
}

0 commit comments

Comments
 (0)