diff --git a/build.gradle b/build.gradle index 7b374ba..957eac3 100644 --- a/build.gradle +++ b/build.gradle @@ -79,9 +79,12 @@ dependencies { implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.12.0' + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.2' + implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.2' + implementation ( - 'org.rundeck:rundeck-core:3.2.4-20200318', - 'org.rundeck:rundeck-storage-api:3.2.4-20200318', + 'org.rundeck:rundeck-core:3.3.+', + 'org.rundeck:rundeck-storage-api:3.3.+', ) testImplementation group: 'junit', name: 'junit', version:'4.12' @@ -125,5 +128,5 @@ jar { } wrapper { - gradleVersion = '6.4.1' + gradleVersion = '6.5.1' } diff --git a/src/main/java/com/bioraft/rundeck/rancher/RancherResourceModelSource.java b/src/main/java/com/bioraft/rundeck/rancher/RancherResourceModelSource.java index bab11c9..97338af 100644 --- a/src/main/java/com/bioraft/rundeck/rancher/RancherResourceModelSource.java +++ b/src/main/java/com/bioraft/rundeck/rancher/RancherResourceModelSource.java @@ -25,8 +25,7 @@ import com.dtolabs.rundeck.core.resources.ResourceModelSourceException; import com.fasterxml.jackson.databind.JsonNode; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; +import org.slf4j.Logger; import java.io.IOException; import java.util.*; @@ -135,15 +134,15 @@ private void getNodesForEnvironment(String environmentId) { environmentName = this.getEnvironmentName(environmentId); } catch (IOException e) { environmentName = environmentId; - logger.log(Level.WARN, "Failed getting environment name"); - logger.log(Level.WARN, e.getMessage()); + logger.warn("Failed getting environment name"); + logger.warn(e.getMessage()); } if (configuration.getProperty(CONFIG_NODE_TYPE_INCLUDE_CONTAINER, "true").equals("true")) { try { data = this.getContainers(environmentId); } catch (IOException e) { - logger.log(Level.WARN, e.getMessage()); + logger.warn(e.getMessage()); return; } for (JsonNode node : data) { @@ -161,7 +160,7 @@ private void getNodesForEnvironment(String environmentId) { addServiceNode(node, environmentName, logger); } } catch (IOException e) { - logger.log(Level.WARN, e.getMessage()); + logger.warn(e.getMessage()); } } } @@ -187,7 +186,7 @@ private void addContainerNode(JsonNode node, String environmentName, Logger logg } iNodeEntries.putNode(nodeEntry); } catch (IllegalArgumentException | NullPointerException e) { - logger.log(Level.WARN, e.getMessage()); + logger.warn(e.getMessage()); } } @@ -197,7 +196,7 @@ private void addServiceNode(JsonNode node, String environmentName, Logger logger NodeEntryImpl nodeEntry = rancherNode.getNodeEntry(environmentName, node); iNodeEntries.putNode(nodeEntry); } catch (IllegalArgumentException | NullPointerException e) { - logger.log(Level.WARN, e.getMessage()); + logger.warn(e.getMessage()); } }