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