BAEL-1958 Log using SLF4J (#4790)

* Log using SLF4J
Jira Ticket: BAEL-1958

* Incorporate first review comments
This commit is contained in:
Saikat 2018-07-31 13:33:04 +05:30 committed by Predrag Maric
parent a1213549f3
commit fb7b7c3ec5
1 changed files with 16 additions and 0 deletions

View File

@ -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"));
}
}