Skip to content

Commit

Permalink
Change logging library to use log4j2 and add log4j2.xml in the util m…
Browse files Browse the repository at this point in the history
…odule
  • Loading branch information
henryken committed Jun 16, 2019
1 parent 6d9e2a2 commit fe5c3c6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion learning/katas/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ buildscript {
guavaVersion = '27.1-jre'
jodaTimeVersion = '2.10.2'
slf4jVersion = '1.7.26'
log4jSlf4jImpl = '2.11.2'

assertjVersion = '3.12.2'
hamcrestVersion = '1.3'
Expand Down Expand Up @@ -57,7 +58,7 @@ subprojects {

compile "joda-time:joda-time:$jodaTimeVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:slf4j-jdk14:$slf4jVersion"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4jSlf4jImpl"
compile "com.google.guava:guava:$guavaVersion"

testCompile "junit:junit:$junitVersion"
Expand All @@ -69,6 +70,7 @@ subprojects {
sourceSets {
main {
java.srcDir 'src'
resources.srcDir 'resources'
}
test {
java.srcDir 'test'
Expand Down
31 changes: 31 additions & 0 deletions learning/katas/java/util/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http:https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level : %msg%n" />
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console" />
</Root>
</Loggers>
</Configuration>

0 comments on commit fe5c3c6

Please sign in to comment.