Today, I walked a lot of detours in learning log4j, so I learned a lot of new things. Log4j learning notes: http://blog.9cbs.net/maxway/archive/2005/01/23/26440.aspx uses log4j in Struts, simply 2 steps below, pity, I started to spend half a day, and again It is servlet to match Web.xml:
Write log4j.properties, throw it to web-inf / class, and the level output in the configuration is higher than INFO. There is OK in the following statements in each need.
Import org.apache.log4j.logger;
Logger logger = logger.getlogger (this.getclass (). Getname ());
IF (logger.isinfoenabled ()) logger.info (this.getClass (). getName ()); // output the class name of the current class