I had upgraded my project from Spring 4 to Spring 5 and I am resolving the deprecated/removed classes. As part of the effort I had noticed that log4jConfigurer is removed from Spring 5.
I have the following code:
<bean
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>file:///${logPropertyFile}</value>
</list>
</property>
</bean>
I am aware of the fact that many had posted a similar question but I don't see any explanation on how to do when I have custom path for the log4j2 configuration file.
I am aware of the fact that we can put it in web.xml file but I want to load a different log file configuration for the child project irrespective of the parent project log configuration. So, Spring context file is best place of it.
I would like to know how to resolve the Log4jConfigurer for custom log file in Spring-5.
Thanks in advance!