Skip to content

Commit 46cf3c3

Browse files
authored
BAEL-1958 Moved the example to logging-modules (eugenp#4886)
1 parent cc4ab48 commit 46cf3c3

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎core-java/src/main/java/com/baeldung/logging/LogUsingSlf4J.java‎

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.baeldung.slf4j;
2+
3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
5+
6+
public class SLF4JLogExceptions {
7+
8+
public static void main(String[] args) {
9+
Logger logger = LoggerFactory.getLogger(SLF4JLogExceptions.class);
10+
11+
logger.error("An exception occurred!");
12+
logger.error("An exception occurred!", new Exception("Custom exception"));
13+
logger.error("{}, {}! An exception occurred!", "Hello", "World", new Exception("Custom exception"));
14+
}
15+
16+
}

0 commit comments

Comments
 (0)