Samples JDK
App.java
1 package com.freemindcafe.apache.log4j.sample2;
2 
3 import java.util.Properties;
4 
5 import org.apache.log4j.Logger;
6 import org.apache.log4j.PropertyConfigurator;
7 
8 public class App {
9  private static final Logger logger = Logger.getLogger("a");
10 
11  public static void main(String[] args) throws Exception {
12  Properties props = new Properties();
13  props.load(App.class.getResourceAsStream("/com/freemindcafe/apache/log4j/sample2/log4j.properties"));
14  PropertyConfigurator.configure(props);
15 
16  FooBean fooBean = new FooBean();
17  BarBean barBean = new BarBean();
18 
19  logger.debug("Hello there from App class!");
20 
21  fooBean.sayHello();
22  barBean.sayHello();
23  }
24 }