Skip to content

Instantly share code, notes, and snippets.

@jgcasta
Last active April 21, 2018 17:25
Show Gist options
  • Save jgcasta/5518661 to your computer and use it in GitHub Desktop.
Save jgcasta/5518661 to your computer and use it in GitHub Desktop.
Spring bean to describe how to load external property file, and Log4j.properties
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>file:///home/pepe/resources/project.properties</value>
</property>
</bean>
<bean id="log4jInitialization"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="staticMethod"
value="org.springframework.util.Log4jConfigurer.initLogging" />
<property name="arguments">
<list>
<value>/home/pepe/resources/projectLog4j.properties</value>
</list>
</property>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment