Skip to content

Commit fb7b7c3

Browse files
Saikatpedja4
authored andcommitted
BAEL-1958 Log using SLF4J (eugenp#4790)
* Log using SLF4J Jira Ticket: BAEL-1958 * Incorporate first review comments
1 parent a121354 commit fb7b7c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.baeldung.logging;
2+
3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
5+
6+
public class LogUsingSlf4J {
7+
8+
public static void main(String[] args) {
9+
Logger logger = LoggerFactory.getLogger(LogUsingSlf4J.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)