Skip to content

Commit ca2a894

Browse files
jaeoptmnoman09muzahidul-opti
authored
add sample log4j config to demo app (#523)
Co-authored-by: Muhammad Noman <[email protected]> Co-authored-by: Muzahidul Islam <[email protected]>
1 parent 6c5e5b2 commit ca2a894

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jsonSimpleVersion = 1.1.1
2020
logbackVersion = 1.2.3
2121
slf4jVersion = 1.7.30
2222
httpClientVersion = 4.5.14
23+
log4jVersion = 2.20.0
2324

2425
# Style Packages
2526
findbugsAnnotationVersion = 3.0.1

java-quickstart/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
apply plugin: 'java'
22

33
dependencies {
4-
compile project(':core-api')
5-
compile project(':core-httpclient-impl')
4+
implementation project(':core-api')
5+
implementation project(':core-httpclient-impl')
66

7-
compile group: 'com.google.code.gson', name: 'gson', version: gsonVersion
8-
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: httpClientVersion
9-
compile group: 'org.slf4j', name: 'slf4j-simple', version: slf4jVersion
7+
implementation group: 'com.google.code.gson', name: 'gson', version: gsonVersion
8+
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: httpClientVersion
9+
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4jVersion
10+
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4jVersion
11+
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4jVersion
1012

11-
testCompile group: 'junit', name: 'junit', version: '4.12'
13+
testImplementation group: 'junit', name: 'junit', version: junitVersion
1214
}
1315

1416
task runExample(type: JavaExec) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Set the root logger level to INFO and its appender to the console
2+
3+
appender.console.type = Console
4+
appender.console.name = STDOUT
5+
appender.console.layout.type = PatternLayout
6+
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
7+
8+
# Specify the loggers
9+
rootLogger.level = debug
10+
rootLogger.appenderRef.stdout.ref = STDOUT

0 commit comments

Comments
 (0)