BAEL-1958 Moved the example to logging-modules (#4886)
This commit is contained in:
parent
cc4ab484cc
commit
46cf3c3997
|
@ -1,16 +0,0 @@
|
||||||
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"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.baeldung.slf4j;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class SLF4JLogExceptions {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Logger logger = LoggerFactory.getLogger(SLF4JLogExceptions.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…
Reference in New Issue