BAEL-1958 Log using SLF4J (#4790)
* Log using SLF4J Jira Ticket: BAEL-1958 * Incorporate first review comments
This commit is contained in:
parent
a1213549f3
commit
fb7b7c3ec5
@ -0,0 +1,16 @@
|
|||||||
|
package com.baeldung.logging;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class LogUsingSlf4J {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Logger logger = LoggerFactory.getLogger(LogUsingSlf4J.class);
|
||||||
|
|
||||||
|
logger.error("An exception occurred!");
|
||||||
|
logger.error("An exception occurred!", new Exception("Custom exception"));
|
||||||
|
logger.error("{}, {}! An exception occurred!", "Hello", "World", new Exception("Custom exception"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user