BAEL-39 - adding SLF4J examples

This commit is contained in:
slavisa-baeldung 2016-09-24 12:01:23 +02:00
parent 7bfa860df9
commit 5a10df3396
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package com.baeldung.slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* To switch between logging frameworks you need only to uncomment needed framework dependencies in pom.xml
*/
public class SLF4JExample {
private static Logger logger = LoggerFactory.getLogger(SLF4JExample.class);
public static void main(String[] args) {
logger.debug("Debug log message");
logger.info("Info log message");
logger.error("Error log message");
String variable = "Hello John";
logger.debug("Printing variable value {} ", variable);
}
}