BAEL-1958 Moved the example to logging-modules (#4886)

This commit is contained in:
Predrag Maric 2018-08-02 11:34:53 +02:00 committed by GitHub
parent cc4ab484cc
commit 46cf3c3997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View File

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

View File

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