1
2
3
4
5
6
7
8
9
10
11 package chapter3;
12
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 import ch.qos.logback.classic.LoggerContext;
17 import ch.qos.logback.core.util.StatusPrinter;
18
19 public class MyApp2 {
20 final static Logger logger = LoggerFactory.getLogger(MyApp2.class);
21
22 public static void main(String[] args) {
23
24 LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
25
26 StatusPrinter.print(lc);
27
28 logger.info("Entering application.");
29 Foo foo = new Foo();
30 foo.doIt();
31 logger.info("Exiting application.");
32 }
33 }