Making migration from log4j 1.2 to new log4j 2. Add to pom:

```
<!-- Add log4j version 2 with 1.2 API -->
    <dependency>
<!--             <groupId>log4j</groupId> -->
<!--             <artifactId>log4j</artifactId> -->
<!--             <version>1.2.9</version> -->
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.0-beta6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-1.2-api</artifactId>
        <version>2.0-beta6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.0-beta6</version>
    </dependency>

```

And try to init it as log4j via Spring context (that works perfectly on log4j 1.2). Use for this such config:

```
<!-- Init log4j with appropriate config according to enviroment -->
<bean id="log4jConfigurer-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>classpath:config/env/log4j-${env.variable}.xml</value>
        </list>
    </property>
</bean>

```

But it seems that now it doesn`t work? What I have done wrong? May be spring config should be modified? Use such dependency for spring:

```
<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
        <version>2.5.3</version>
        <exclusions>
            <exclusion>
                <artifactId>servlet-api</artifactId>
                <groupId>javax.servlet</groupId>
            </exclusion>
        </exclusions>
    </dependency>

```