diff --git a/gradle.properties b/gradle.properties index f8816af24..ef1dd8bfd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,6 +20,7 @@ jsonSimpleVersion = 1.1.1 logbackVersion = 1.2.3 slf4jVersion = 1.7.30 httpClientVersion = 4.5.14 +log4jVersion = 2.20.0 # Style Packages findbugsAnnotationVersion = 3.0.1 diff --git a/java-quickstart/build.gradle b/java-quickstart/build.gradle index 3e6a978f8..a58fb090e 100644 --- a/java-quickstart/build.gradle +++ b/java-quickstart/build.gradle @@ -1,14 +1,16 @@ apply plugin: 'java' dependencies { - compile project(':core-api') - compile project(':core-httpclient-impl') + implementation project(':core-api') + implementation project(':core-httpclient-impl') - compile group: 'com.google.code.gson', name: 'gson', version: gsonVersion - compile group: 'org.apache.httpcomponents', name: 'httpclient', version: httpClientVersion - compile group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion + implementation group: 'com.google.code.gson', name: 'gson', version: gsonVersion + implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: httpClientVersion + implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4jVersion + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4jVersion + implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4jVersion - testCompile group: 'junit', name: 'junit', version: '4.12' + testImplementation group: 'junit', name: 'junit', version: junitVersion } task runExample(type: JavaExec) { diff --git a/java-quickstart/src/main/resources/log4j2.properties b/java-quickstart/src/main/resources/log4j2.properties new file mode 100644 index 000000000..d67078d5a --- /dev/null +++ b/java-quickstart/src/main/resources/log4j2.properties @@ -0,0 +1,10 @@ +# Set the root logger level to INFO and its appender to the console + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + +# Specify the loggers +rootLogger.level = debug +rootLogger.appenderRef.stdout.ref = STDOUT