1. Log4j.properties will be tested when using the JUnit local test below:
Log4J: Warn no appenders could be found for logger (org.springframework.beans.factory.access.singletonbeanfactoryLocator) .log4j: warn please initialize the log4j system protralize.
Then we can't see the configuration information of Spring load beans. Add: log4j.properties under the ClassPath path, you can display the loading information of Bean
2. Configuring log4jspring for Spring in web applications is to use a servlet listner. When the Web Container is started, the root's absolute path is written to the system variable, so you can use $ {myAppfuse.root} in the log4j configuration file. Indicates the system variable just set up: log4j.Appender.logfile.file = $ {myappfuse.root} /logs/mylog.log In Web.xml configuration statement is as follows: