시스템을 운영하는 중 Log4j 설정 파일을 변경하여 반영.
One possibility is to configure it in your applicationContext.xml as shown her
<bean id="log4jInitialization"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass"
value="org.springframework.util.Log4jConfigurer" />
<property name="targetMethod" value="initLogging" />
<property name="arguments">
<list>
<value>conf/log4j.xml</value>
</list>
</property>
</bean>
If you are running your web application as an expanded war then another option is to use a listener in your web.xml.
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/resources/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>1000</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
'Java' 카테고리의 다른 글
| Log4j 설정파일 Refresh (0) | 2011/11/25 |
|---|---|
| Java로 MS Excel, Word, Powerpoint 문서 다루기 (0) | 2011/09/27 |
| Java Class Dynamic reloading (0) | 2011/09/05 |




댓글을 달아 주세요