Skip to content

Commit 5a10df3

Browse files
BAEL-39 - adding SLF4J examples
1 parent 7bfa860 commit 5a10df3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.baeldung.slf4j;
2+
3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
5+
6+
/**
7+
* To switch between logging frameworks you need only to uncomment needed framework dependencies in pom.xml
8+
*/
9+
public class SLF4JExample {
10+
private static Logger logger = LoggerFactory.getLogger(SLF4JExample.class);
11+
12+
public static void main(String[] args) {
13+
logger.debug("Debug log message");
14+
logger.info("Info log message");
15+
logger.error("Error log message");
16+
17+
String variable = "Hello John";
18+
logger.debug("Printing variable value {} ", variable);
19+
}
20+
}

0 commit comments

Comments
 (0)