Skip to content

Commit

Permalink
Merge pull request #112 from rundeck-plugins/logging-to-slf4j
Browse files Browse the repository at this point in the history
Update dependencies and gradlew version. Update logging to use slf4j.
  • Loading branch information
sjrd218 authored Mar 30, 2021
2 parents cd10540 + 4fd0bd6 commit 1de4361
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

plugins {
id 'pl.allegro.tech.build.axion-release' version '1.5.0'
id 'pl.allegro.tech.build.axion-release' version '1.9.3'
}

apply plugin: 'java'
Expand Down Expand Up @@ -55,22 +55,24 @@ repositories {
}
}
dependencies {
compile group:"org.slf4j", name:"slf4j-api", version:"1.7.30"
compile group: 'org.rundeck', name: 'rundeck-core', version: '2.2.2'
compile "com.amazonaws:aws-java-sdk-core:1.11.743"
compile "com.amazonaws:aws-java-sdk-sts:1.11.743"
compile "com.fasterxml.jackson.core:jackson-databind:2.9.9.3"
compile "com.fasterxml.jackson.core:jackson-databind:2.10.5.1"
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'

pluginLibs group: 'apache-log4j', name: 'apache-log4j', version: '1.2.15'
pluginLibs group: 'stax', name: 'stax', version: '1.2.0'
pluginLibs group: 'stax-api', name: 'stax-api', version: '1.0.1'

pluginLibs (group: 'com.amazonaws', name: 'aws-java-sdk-ec2', version: '1.11.743') {
exclude group: "com.fasterxml.jackson.core"
exclude group: "com.fasterxml.jackson.dataformat"
}

pluginLibs (group: 'com.amazonaws', name: 'aws-java-sdk-sts', version: '1.11.743') {
exclude group: "com.fasterxml.jackson.core"
exclude group: "com.fasterxml.jackson.dataformat"
}

testCompile "org.codehaus.groovy:groovy-all:2.3.7"
Expand Down Expand Up @@ -107,6 +109,3 @@ jar {
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)

task wrapper(type: Wrapper) {
gradleVersion = '3.5.1'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
import com.dtolabs.rundeck.core.plugins.configuration.ConfigurationException;
import com.dtolabs.rundeck.core.resources.ResourceModelSource;
import com.dtolabs.rundeck.core.resources.ResourceModelSourceException;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.util.*;
Expand All @@ -58,7 +59,7 @@
* @author Greg Schueler <a href="mailto:[email protected]">[email protected]</a>
*/
public class EC2ResourceModelSource implements ResourceModelSource {
static Logger logger = Logger.getLogger(EC2ResourceModelSource.class);
static Logger logger = LoggerFactory.getLogger(EC2ResourceModelSource.class);
private String accessKey;
private String secretKey;
long refreshInterval = 30000;
Expand Down Expand Up @@ -272,7 +273,7 @@ private void checkFuture() {
try {
iNodeSet = futureResult.get();
} catch (InterruptedException e) {
logger.debug(e);
logger.debug("Interrupted",e);
} catch (ExecutionException e) {
logger.warn("Error performing query: " + e.getMessage(), e);
}
Expand Down Expand Up @@ -300,7 +301,7 @@ private void loadMapping() {
fileInputStream.close();
}
} catch (IOException e) {
logger.warn(e);
logger.warn("Error loading mapping file",e);
}
}
if (null != mappingParams) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import com.dtolabs.rundeck.core.common.NodeEntryImpl;
import com.dtolabs.rundeck.core.common.NodeSetImpl;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;
import java.util.concurrent.Executors;
Expand All @@ -46,8 +47,8 @@
* @author Greg Schueler <a href="mailto:[email protected]">[email protected]</a>
*/
class InstanceToNodeMapper {
static final Logger logger = Logger.getLogger(InstanceToNodeMapper.class);
final AWSCredentials credentials;
static final Logger logger = LoggerFactory.getLogger(InstanceToNodeMapper.class);
final AWSCredentials credentials;
private ClientConfiguration clientConfiguration;
private ExecutorService executorService = Executors.newSingleThreadExecutor();
private ArrayList<String> filterParams;
Expand Down Expand Up @@ -164,7 +165,7 @@ private void mapInstances(final NodeSetImpl nodeSet, final Set<Instance> instanc
nodeSet.putNode(iNodeEntry);
}
} catch (GeneratorException e) {
logger.error(e);
logger.error("Generator error",e);
}
}
}
Expand Down

0 comments on commit 1de4361

Please sign in to comment.