diff --git a/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java
index 5ee913d251..f14aa2b0d2 100644
--- a/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java
+++ b/algorithms-miscellaneous-6/src/main/java/com/baeldung/algorithms/caesarcipher/CaesarCipher.java
@@ -1,11 +1,16 @@
package com.baeldung.algorithms.caesarcipher;
import org.apache.commons.math3.stat.inference.ChiSquareTest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.stream.IntStream;
public class CaesarCipher {
+
+ private final Logger log = LoggerFactory.getLogger(CaesarCipher.class);
+
private static final char LETTER_A = 'a';
private static final char LETTER_Z = 'z';
private static final int ALPHABET_SIZE = LETTER_Z - LETTER_A + 1;
@@ -72,7 +77,7 @@ public class CaesarCipher {
private int probableOffset(double[] chiSquares) {
int probableOffset = 0;
for (int offset = 0; offset < chiSquares.length; offset++) {
- System.out.println(String.format("Chi-Square for offset %d: %.2f", offset, chiSquares[offset]));
+ log.debug(String.format("Chi-Square for offset %d: %.2f", offset, chiSquares[offset]));
if (chiSquares[offset] < chiSquares[probableOffset]) {
probableOffset = offset;
}
diff --git a/algorithms-miscellaneous-6/src/main/resources/logback.xml b/algorithms-miscellaneous-6/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/algorithms-miscellaneous-6/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/algorithms-searching/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java b/algorithms-searching/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java
index 9d301f9578..ef1c7393c8 100644
--- a/algorithms-searching/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java
+++ b/algorithms-searching/src/main/java/com/baeldung/algorithms/breadthfirstsearch/BreadthFirstSearchAlgorithm.java
@@ -16,7 +16,7 @@ public class BreadthFirstSearchAlgorithm {
Tree currentNode;
while (!queue.isEmpty()) {
currentNode = queue.remove();
- LOGGER.info("Visited node with value: {}", currentNode.getValue());
+ LOGGER.debug("Visited node with value: {}", currentNode.getValue());
if (currentNode.getValue().equals(value)) {
return Optional.of(currentNode);
@@ -37,7 +37,7 @@ public class BreadthFirstSearchAlgorithm {
while (!queue.isEmpty()) {
currentNode = queue.remove();
- LOGGER.info("Visited node with value: {}", currentNode.getValue());
+ LOGGER.debug("Visited node with value: {}", currentNode.getValue());
if (currentNode.getValue().equals(value)) {
return Optional.of(currentNode);
diff --git a/algorithms-searching/src/test/java/com/baeldung/algorithms/quadtree/QuadTreeSearchUnitTest.java b/algorithms-searching/src/test/java/com/baeldung/algorithms/quadtree/QuadTreeSearchUnitTest.java
index faf06ced31..4389795ffb 100644
--- a/algorithms-searching/src/test/java/com/baeldung/algorithms/quadtree/QuadTreeSearchUnitTest.java
+++ b/algorithms-searching/src/test/java/com/baeldung/algorithms/quadtree/QuadTreeSearchUnitTest.java
@@ -35,6 +35,7 @@ public class QuadTreeSearchUnitTest {
public void givenQuadTree_whenSearchingForRange_thenReturn1MatchingItem() {
Region searchArea = new Region(200, 200, 250, 250);
List result = quadTree.search(searchArea, null, "");
+
LOGGER.debug(result.toString());
LOGGER.debug(quadTree.printSearchTraversePath());
@@ -47,6 +48,7 @@ public class QuadTreeSearchUnitTest {
public void givenQuadTree_whenSearchingForRange_thenReturn2MatchingItems() {
Region searchArea = new Region(0, 0, 100, 100);
List result = quadTree.search(searchArea, null, "");
+
LOGGER.debug(result.toString());
LOGGER.debug(quadTree.printSearchTraversePath());
diff --git a/algorithms-searching/src/test/java/com/baeldung/algorithms/suffixtree/SuffixTreeUnitTest.java b/algorithms-searching/src/test/java/com/baeldung/algorithms/suffixtree/SuffixTreeUnitTest.java
index ef4a05a9a1..d9a4f2962c 100644
--- a/algorithms-searching/src/test/java/com/baeldung/algorithms/suffixtree/SuffixTreeUnitTest.java
+++ b/algorithms-searching/src/test/java/com/baeldung/algorithms/suffixtree/SuffixTreeUnitTest.java
@@ -24,7 +24,7 @@ public class SuffixTreeUnitTest {
public void givenSuffixTree_whenSearchingForA_thenReturn6Matches() {
List matches = suffixTree.searchText("a");
matches.stream()
- .forEach(m -> LOGGER.info(m));
+ .forEach(m -> LOGGER.debug(m));
Assert.assertArrayEquals(new String[] { "h[a]vanabanana", "hav[a]nabanana", "havan[a]banana", "havanab[a]nana", "havanaban[a]na", "havanabanan[a]" }, matches.toArray());
}
@@ -32,7 +32,7 @@ public class SuffixTreeUnitTest {
public void givenSuffixTree_whenSearchingForNab_thenReturn1Match() {
List matches = suffixTree.searchText("nab");
matches.stream()
- .forEach(m -> LOGGER.info(m));
+ .forEach(m -> LOGGER.debug(m));
Assert.assertArrayEquals(new String[] { "hava[nab]anana" }, matches.toArray());
}
@@ -40,7 +40,7 @@ public class SuffixTreeUnitTest {
public void givenSuffixTree_whenSearchingForNag_thenReturnNoMatches() {
List matches = suffixTree.searchText("nag");
matches.stream()
- .forEach(m -> LOGGER.info(m));
+ .forEach(m -> LOGGER.debug(m));
Assert.assertArrayEquals(new String[] {}, matches.toArray());
}
@@ -48,7 +48,7 @@ public class SuffixTreeUnitTest {
public void givenSuffixTree_whenSearchingForBanana_thenReturn2Matches() {
List matches = suffixTree.searchText("ana");
matches.stream()
- .forEach(m -> LOGGER.info(m));
+ .forEach(m -> LOGGER.debug(m));
Assert.assertArrayEquals(new String[] { "hav[ana]banana", "havanab[ana]na", "havanaban[ana]" }, matches.toArray());
}
@@ -56,7 +56,7 @@ public class SuffixTreeUnitTest {
public void givenSuffixTree_whenSearchingForNa_thenReturn4Matches() {
List matches = suffixTree.searchText("na");
matches.stream()
- .forEach(m -> LOGGER.info(m));
+ .forEach(m -> LOGGER.debug(m));
Assert.assertArrayEquals(new String[] { "hava[na]banana", "havanaba[na]na", "havanabana[na]" }, matches.toArray());
}
@@ -64,14 +64,14 @@ public class SuffixTreeUnitTest {
public void givenSuffixTree_whenSearchingForX_thenReturnNoMatches() {
List matches = suffixTree.searchText("x");
matches.stream()
- .forEach(m -> LOGGER.info(m));
+ .forEach(m -> LOGGER.debug(m));
Assert.assertArrayEquals(new String[] {}, matches.toArray());
}
private static void printTree() {
suffixTree.printTree();
- LOGGER.info("\n" + suffixTree.printTree());
- LOGGER.info("==============================================");
+ LOGGER.debug("\n" + suffixTree.printTree());
+ LOGGER.debug("==============================================");
}
}
diff --git a/apache-olingo/olingo2/src/main/resources/logback.xml b/apache-olingo/olingo2/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/apache-olingo/olingo2/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apache-shiro/src/main/resources/logback.xml b/apache-shiro/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/apache-shiro/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-jndi/src/test/resources/logback.xml b/core-java-modules/core-java-jndi/src/test/resources/logback.xml
index e55b365ba4..eaad569e43 100644
--- a/core-java-modules/core-java-jndi/src/test/resources/logback.xml
+++ b/core-java-modules/core-java-jndi/src/test/resources/logback.xml
@@ -1,13 +1,13 @@
-
-
-
-
- %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
diff --git a/core-java-modules/core-java-lambdas/src/main/resources/logback.xml b/core-java-modules/core-java-lambdas/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-lambdas/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-lang-syntax/src/main/resources/logback.xml b/core-java-modules/core-java-lang-syntax/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-lang-syntax/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-networking-3/src/main/resources/logback.xml b/core-java-modules/core-java-networking-3/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-networking-3/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-nio-2/src/main/resources/logback.xml b/core-java-modules/core-java-nio-2/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-nio-2/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-reflection-2/src/main/resources/logback.xml b/core-java-modules/core-java-reflection-2/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-reflection-2/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-java-modules/core-java-string-operations-2/src/main/resources/logback.xml b/core-java-modules/core-java-string-operations-2/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/core-java-modules/core-java-string-operations-2/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jta/src/main/resources/resources b/jta/src/main/resources/resources
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/jta/src/main/resources/resources
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kubernetes/k8s-admission-controller/src/main/resources/logback.xml b/kubernetes/k8s-admission-controller/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/kubernetes/k8s-admission-controller/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries-3/src/main/resources/logback.xml b/libraries-3/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/libraries-3/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries-security/src/main/resources/logback.xml b/libraries-security/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/libraries-security/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/hibernate5/src/main/resources/log4j.properties b/persistence-modules/hibernate5/src/main/resources/log4j.properties
new file mode 100644
index 0000000000..2173c5d96f
--- /dev/null
+++ b/persistence-modules/hibernate5/src/main/resources/log4j.properties
@@ -0,0 +1 @@
+log4j.rootLogger=INFO, stdout
diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/logback.xml b/persistence-modules/spring-boot-persistence-h2/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-mybatis/src/main/resources/logback.xml b/persistence-modules/spring-mybatis/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/persistence-modules/spring-mybatis/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-persistence-simple/src/main/resources/logback.xml b/persistence-modules/spring-persistence-simple/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/persistence-modules/spring-persistence-simple/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactor-core/src/main/resources/logback.xml b/reactor-core/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/reactor-core/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/software-security/sql-injection-samples/src/main/resources/logback.xml b/software-security/sql-injection-samples/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/software-security/sql-injection-samples/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-1/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-1/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-1/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-annotations/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-annotations/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-annotations/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-data-2/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-data-2/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-data-2/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-properties/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-properties/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-boot-modules/spring-boot-properties/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spring-caching/src/main/resources/logback.xml b/spring-caching/src/main/resources/logback.xml
new file mode 100644
index 0000000000..7d900d8ea8
--- /dev/null
+++ b/spring-caching/src/main/resources/logback.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
\ No newline at end of file