When deploying two or more projects under Tomcat, it is best to define the Webapprootkey parameter in the Web. xml file and, if undefined, default to "Webapp.root", as follows:
<!--Application Path - <Context-param> <Param-name>Webapprootkey</Param-name> <Param-value>Webapp.root</Param-value> </Context-param>
Best newspaper The parameter values for each item are different to avoid conflicting items
Severity: Exception sending context initialized event to listener instance of class Org.springframework.web.util.Log4jConfigLis Tener
Java.lang.IllegalStateException:Web App root system property already set to different value: ' Webapp.root ' = [C:\Program Files (x86) \apache software Foundation\tomcat 6.0\webapps\drmproject\] instead of [C:\Program Files (x86) \apache Software Foundation\tomcat 6.0\webapps\drmsn\]-Choose unique values for the ' Webapprootkey ' Context-param in your WEB.XM L files!
For multiple projects to configure the Webapprootkey , here is to let log can write to the corresponding project root directory, such as I configured the Webapprootkey of the two projects for
XML code
<!--Application Path - <Context-param> <Param-name>Webapprootkey</Param-name> <Param-value>Webapp.root1</Param-value> </Context-param>
<!--Application Path - <Context-param> <Param-name>Webapprootkey</Param-name> <Param-value>Webapp.root2</Param-value> </Context-param>
So there will be no conflict.
After
is defined, the absolute path to root is written to the system variable when the Web Container boot .
then log4j configuration file you can use ${webname.root} to represent the absolute path to the Web directory. Store the log file in the WebApp.