Log4j2和Spring 4

时间:2017-02-10 10:56:26

标签: spring slf4j log4j2

我无法让Log4j2在日志文件上写入Spring和Spring Security日志消息(后者我绝对需要to solve an issue)。我在这里和其他地方已经阅读了很多内容(当然在Spring reference中),但是我无法使我发现的解决方案适用于我的案例。

重要的是要注意,在下面的两个解决方案中,我的日志记录消息和休眠日志消息都在文件中正确写入。该问题仅影响Spring消息。

据我所知,Spring使用jcl(commons-logging),有两种方法让Spring使用Log4j2:

  • 只需添加网桥 log4j-jcl (jcl - > log4j2)
  • 使用SLF4J与 jcl-over-jcl log4j-slf4j-impl (jcl - > slf4j - > log4j2)

我试图从其他所有依赖项中排除公共日志记录,以便手动控制其包含。在第一个解决方案中,我将其包括在内,在第二个解决方案中我将其排除在外,但我已经看到了关于该主题的不同意见。无论如何,在这两种情况下Spring都不会记录。

我可以看到hibernate使用 jboss-logging 。这就是为什么它适用于这两种配置的原因?它可以包含在Spring日志记录中吗?

应用程序服务器可能存在问题吗?也许默认情况下加载的某些库会覆盖应用程序库造成混乱?

这是我的环境:

  • Java 1.6
  • Servlet 2.5
  • Oracle weblogic 12.1
  • Spring MVC 4.3.4.RELEASE
  • Spring Security 4.2.0.RELEASE
  • Log4j 2.3(最新版本与Java 6兼容)
  • Hibernate实体管理器4.2.21.final
  • SLF4J 1.7.22

我想存在依赖性问题:某些库不应存在或缺少。

修改 在我的依赖树中,我没有看到spring-corecommons-logging的依赖,就像参考文献所说的那样。我可以在spring-data-jpaslf4j上看到jcl-over-slf4j之一。正如rgoers所说,jcl-over-sl4j shluld的存在是问题所在。我会更新结果......

所以这是我的 pom.xml 依赖项部分(你可以看到有两个不同的日志记录依赖项配置,一个评论;这两个配置都使我的和hibernate日志工作正常,但都没有两个让Spring写的是:)

<properties>
    <spring.version>4.3.4.RELEASE</spring.version>
    <spring.security.version>4.2.0.RELEASE</spring.security.version>
    <!--<spring.data.jpa.version>1.10.5.RELEASE</spring.data.jpa.version>-->
    <spring.data.jpa.version>1.7.2.RELEASE</spring.data.jpa.version>
    <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
    <log4j.version>2.3</log4j.version>
    <hibernate.validator.version>5.3.2.Final</hibernate.validator.version>
    <hibernate.entitymanager.version>4.2.21.Final</hibernate.entitymanager.version> <!-- LAST VERSION SUPPORTING JPA 2.0 (JPA 2.1 is not supported by WebLogic 12.1.1) -->
    <javax.transaction.version>1.1</javax.transaction.version>
    <oracle.jdbc.version>12.1.0.2</oracle.jdbc.version>
    <querydsl.jpa.version>3.6.9</querydsl.jpa.version>
    <google.guava.version>18.0</google.guava.version>
    <quartz.version>2.2.1</quartz.version>
    <pdfbox.version>2.0.4</pdfbox.version>

</properties>

<dependencies>

    <!-- SPRING SECURITY -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${spring.security.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${spring.security.version}</version>
    </dependency>

    <!-- WEB AND VALIDATION -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${hibernate.validator.version}</version>
    </dependency>

    <!-- THYMELEAF -->
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring4</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>
    <dependency>
        <groupId>com.github.mxab.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-data-attribute</artifactId>
        <version>2.0.1</version>
    </dependency>

    <!-- LOGGING -->

    <!-- Using JCL -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-web</artifactId>
        <version>${log4j.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jcl</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <!-- Using SLF4J -->
    <!--
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.22</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.22</version>
    </dependency>
    &lt;!&ndash;<dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.1</version>
    </dependency>&ndash;&gt;

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    &lt;!&ndash;<dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jcl</artifactId>
        <version>${log4j.version}</version>
    </dependency>&ndash;&gt;
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-web</artifactId>
        <version>${log4j.version}</version>
        <scope>runtime</scope>
    </dependency>
    -->

    <!-- PERSISTENCE LIBRARIES -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.entitymanager.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>${javax.transaction.version}</version>
    </dependency>

    <!-- SPRING FRAMEWORK COMPONENTS -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>${spring.data.jpa.version}</version>
    </dependency>

    <!-- ORACLE JDBC -->
    <dependency>
        <groupId>com.oracle.jdbc</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>${oracle.jdbc.version}</version>
    </dependency>

    <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.10</version>
        <!--<exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>-->
    </dependency>

    <!-- SPRING-DATA JPA DATATABLES -->
    <dependency>
        <groupId>com.github.darrachequesne</groupId>
        <artifactId>spring-data-jpa-datatables</artifactId>
        <version>3.0</version>
    </dependency>

    <!-- QUERYDSL -->
    <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-jpa</artifactId>
        <version>${querydsl.jpa.version}</version>
    </dependency>

    <!-- GOOGLE GUAVA UTILS -->
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${google.guava.version}</version>
    </dependency>

    <!-- APACHE PDF BOX -->
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox</artifactId>
        <version>${pdfbox.version}</version>
        <!--<exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>-->
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>fontbox</artifactId>
        <version>${pdfbox.version}</version>
        <!--<exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>-->
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox-tools</artifactId>
        <version>${pdfbox.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-csv</artifactId>
        <version>1.1</version>
    </dependency>

    <!-- ESAPI security features (prevent sql injection during password change -->
    <dependency>
        <groupId>org.owasp.esapi</groupId>
        <artifactId>esapi</artifactId>
        <version>2.1.0.1</version>
        <exclusions>
            <!--<exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>-->
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>${quartz.version}</version>
    </dependency>
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz-jobs</artifactId>
        <version>${quartz.version}</version>
    </dependency>


</dependencies>

这是我的 log4j2配置。但我真的不认为这个问题就在这里。

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn">

<Properties>
    <Property name="basePath">..\\logs\\myapp\\</Property>
</Properties>

<Appenders>
    <RollingFile name="fileLogger" fileName="${basePath}myapp.log" filePattern="${basePath}myapp-%d{yyyy-MM-dd}.log">
        <PatternLayout>
            <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} %c{10} - %msg%n</pattern>
        </PatternLayout>
        <Policies>
            <TimeBasedTriggeringPolicy interval="1" modulate="true" />
        </Policies>
    </RollingFile>

    <Console name="console" target="SYSTEM_OUT">
        <PatternLayout   pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} %c{10} - %msg%n" />
    </Console>
</Appenders>

<Loggers>
    <Logger name="com.myapp" level="debug" additivity="true">
        <appender-ref ref="fileLogger" level="debug" />
    </Logger>
    <Logger name="org.springframework" level="info" additivity="true">
        <appender-ref ref="fileLogger" level="info" />
    </Logger>
    <!--<Logger name="org.springframework.security" level="debug" additivity="true">
        <appender-ref ref="fileLogger" level="debug" />
    </Logger>-->
    <Logger name="org.thymeleaf" level="info" additivity="true">
        <appender-ref ref="fileLogger" level="info" />
    </Logger>

    <Logger name="org.hibernate" level="debug" additivity="true">
        <appender-ref ref="fileLogger" level="debug" />
    </Logger>

    <Root level="info" additivity="false">
        <appender-ref ref="console" />
    </Root>
</Loggers>
</Configuration>

以下是我战争中的图书馆,也许还有一些障碍。

antisamy-1.5.3.jar
antlr-2.7.7.jar
aopalliance-1.0.jar
aspectjrt-1.8.4.jar
attoparser-2.0.1.RELEASE.jar
batik-css-1.8.jar
batik-ext-1.8.jar
batik-util-1.8.jar
bridge-method-annotation-1.13.jar
bsh-core-2.0b4.jar
c3p0-0.9.1.1.jar
classmate-1.3.1.jar
codegen-0.6.8.jar
commons-beanutils-core-1.8.3.jar
commons-codec-1.2.jar
commons-collections-3.2.2.jar
commons-configuration-1.10.jar
commons-csv-1.1.jar
commons-fileupload-1.3.1.jar
commons-httpclient-3.1.jar
commons-io-1.3.2.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
dom4j-1.6.1.jar
ecj-4.3.1.jar
esapi-2.1.0.1.jar
fontbox-2.0.4.jar
guava-18.0.jar
hibernate-commons-annotations-4.0.2.Final.jar
hibernate-core-4.2.21.Final.jar
hibernate-entitymanager-4.2.21.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-validator-5.3.2.Final.jar
jackson-annotations-2.6.0.jar
jackson-core-2.6.6.jar
jackson-databind-2.6.6.jar
javassist-3.18.1-GA.jar
javax.el-api-2.2.5.jar
javax.inject-1.jar
jboss-logging-3.3.0.Final.jar
jboss-transaction-api_1.1_spec-1.0.1.Final.jar
jcl-over-slf4j-1.7.10.jar
jsr305-1.3.9.jar
jta-1.1.jar
log4j-api-2.3.jar
log4j-core-2.3.jar
log4j-jcl-2.3.jar
log4j-web-2.3.jar
mysema-commons-lang-0.2.4.jar
nekohtml-1.9.16.jar
ognl-3.1.10.jar
ojdbc7-12.1.0.2.jar
pdfbox-2.0.4.jar
pdfbox-debugger-2.0.4.jar
pdfbox-tools-2.0.4.jar
quartz-2.2.1.jar
quartz-jobs-2.2.1.jar
querydsl-apt-3.6.9.jar
querydsl-codegen-3.6.9.jar
querydsl-core-3.6.9.jar
querydsl-jpa-3.6.9.jar
slf4j-api-1.6.6.jar
spring-aop-4.3.4.RELEASE.jar
spring-beans-4.3.4.RELEASE.jar
spring-context-4.3.4.RELEASE.jar
spring-core-4.3.4.RELEASE.jar
spring-data-commons-1.9.2.RELEASE.jar
spring-data-jpa-1.7.2.RELEASE.jar
spring-data-jpa-datatables-3.0.jar
spring-expression-4.3.4.RELEASE.jar
spring-jdbc-4.3.4.RELEASE.jar
spring-orm-4.3.4.RELEASE.jar
spring-security-config-4.2.0.RELEASE.jar
spring-security-core-4.2.0.RELEASE.jar
spring-security-web-4.2.0.RELEASE.jar
spring-tx-4.3.4.RELEASE.jar
spring-web-4.3.4.RELEASE.jar
spring-webmvc-4.3.4.RELEASE.jar
thymeleaf-3.0.2.RELEASE.jar
thymeleaf-extras-data-attribute-2.0.1.jar
thymeleaf-spring4-3.0.2.RELEASE.jar
unbescape-1.1.4.RELEASE.jar
validation-api-1.1.0.Final.jar
xalan-2.7.0.jar
xercesImpl-2.8.0.jar
xml-apis-1.3.03.jar
xml-apis-ext-1.3.04.jar
xom-1.2.5.jar

赞赏每一个建议。

谢谢大家, dolfiz

4 个答案:

答案 0 :(得分:4)

我有几个Spring应用程序使用Log4j 2进行日志记录。正如您所说的那样,建议的方法是将commons-logging jar保留在其中并使用log4j-jcl将其桥接到Log4j 2.在这种情况下,jcl-over- slf4j jar一定不能出现。在这种情况下,日志记录调用将是commons-logging - &gt; log4j-jcl - &gt; log4j的API。

正如您所说,另一种方法是删除commons-logging jar并将其替换为jcl-over-slf4j。然后你需要你注释掉的所有罐子。在这种情况下,日志记录调用将是jcl-over-slf4j - &gt; slf4j-api - &gt; log4j-slf4j-impl - &gt; log4j的API。

正如您所看到的,第二条路径稍长。

BTW - 您的log4j2配置缺少包装<configuration>元素。

答案 1 :(得分:1)

https://www.slf4j.org/legacy.html slf4j legacy

正如您所看到的,您需要添加jcl-over-slf4j.jar并排除commons-logging.jar(两者内部都有相同的文件结构,请检查它)之后,请添加slf4j-api.jar,桥slf4j-log4j.jar和实际的日志记录实现 - log4j.jar

检查结果war文件中的commons-logging.jar,它不应该出现。

答案 2 :(得分:1)

确保JCL是由Log4j2实现的,而不是通过桥接到其他日志记录框架实现的,请避免使用诸如“ org.slf4j:jcl-over-slf4j”之类的依赖项。

要强制执行此操作(即,如果再次将错误的依赖项再次添加到项目中,则会快速失败),您可以为maven-enforcer-plugin添加规则:

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <executions>
        <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
                <goal>enforce</goal>
            </goals>
            <configuration>
                <rules>
                    <bannedDependencies>
                        <excludes>
                            <!-- Prohibit routing Apache Commons Logging API via SLF4J, use more direct route to Log4j2. -->
                            <exclude>org.slf4j:jcl-over-slf4j</exclude>
                            <!-- Prohibit routing "java.util.logging" API via SLF4J, use more direct route to Log4j2. -->
                            <exclude>org.slf4j:jul-to-slf4j</exclude>
                            <!-- Prohibit routing log4j-1.2 via SLF4J, use more direct route to Log4j2. -->
                            <exclude>org.slf4j:log4j-over-slf4j</exclude>
                        </excludes>
                    </bannedDependencies>
                </rules>
            </configuration>
        </execution>
    </executions>
</plugin>

答案 3 :(得分:0)

正如rgoers在回复中正确地说,如果我们选择使用log4j-jcl网桥,我们必须排除jcl-over-slf4j的所有依赖关系。就我而言,它是由spring-data-jpa引入的。以下是我的最后一个pom。我终于可以看到春天和春天的安全日志了。

下一步将尝试正确引入slf4j,以便获取spring-data-jpa和thymeleaf的日志。

再次感谢指出解决方案的rgoers。

<properties>
    <spring.version>4.3.4.RELEASE</spring.version>
    <spring.security.version>4.2.0.RELEASE</spring.security.version>
    <spring.data.jpa.version>1.7.2.RELEASE</spring.data.jpa.version>
    <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
    <log4j.version>2.3</log4j.version>
    <hibernate.validator.version>5.3.2.Final</hibernate.validator.version>
    <hibernate.entitymanager.version>4.2.21.Final</hibernate.entitymanager.version> <!-- LAST VERSION SUPPORTING JPA 2.0 (JPA 2.1 is not supported by WebLogic 12.1.1) -->
    <javax.transaction.version>1.1</javax.transaction.version>
    <oracle.jdbc.version>12.1.0.2</oracle.jdbc.version>
    <querydsl.jpa.version>3.6.9</querydsl.jpa.version>
    <google.guava.version>18.0</google.guava.version>
    <quartz.version>2.2.1</quartz.version>
    <pdfbox.version>2.0.4</pdfbox.version>
</properties>

<dependencies>

    <!-- SPRING SECURITY -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${spring.security.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${spring.security.version}</version>
    </dependency>

    <!-- WEB AND VALIDATION -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${hibernate.validator.version}</version>
    </dependency>

    <!-- THYMELEAF -->
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring4</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>
    <dependency>
        <groupId>com.github.mxab.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-data-attribute</artifactId>
        <version>2.0.1</version>
    </dependency>

    <!-- LOGGING -->

    <!-- Using JCL -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-web</artifactId>
        <version>${log4j.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jcl</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <!-- Using SLF4J -->
    <!--
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.22</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.22</version>
    </dependency>
    &lt;!&ndash;<dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.1</version>
    </dependency>&ndash;&gt;

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    &lt;!&ndash;<dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jcl</artifactId>
        <version>${log4j.version}</version>
    </dependency>&ndash;&gt;
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-web</artifactId>
        <version>${log4j.version}</version>
        <scope>runtime</scope>
    </dependency>
    -->

    <!-- PERSISTENCE LIBRARIES -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.entitymanager.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>${javax.transaction.version}</version>
    </dependency>

    <!-- SPRING FRAMEWORK COMPONENTS -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>${spring.data.jpa.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- ORACLE JDBC -->
    <dependency>
        <groupId>com.oracle.jdbc</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>${oracle.jdbc.version}</version>
    </dependency>

    <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.10</version>
        <!--<exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>-->
    </dependency>

    <!-- SPRING-DATA JPA DATATABLES -->
    <dependency>
        <groupId>com.github.darrachequesne</groupId>
        <artifactId>spring-data-jpa-datatables</artifactId>
        <version>3.0</version>
    </dependency>

    <!-- QUERYDSL -->
    <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-jpa</artifactId>
        <version>${querydsl.jpa.version}</version>
    </dependency>

    <!-- GOOGLE GUAVA UTILS -->
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${google.guava.version}</version>
    </dependency>

    <!-- APACHE PDF BOX -->
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox</artifactId>
        <version>${pdfbox.version}</version>
        <!--<exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>-->
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>fontbox</artifactId>
        <version>${pdfbox.version}</version>
        <!--<exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>-->
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox-tools</artifactId>
        <version>${pdfbox.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-csv</artifactId>
        <version>1.1</version>
    </dependency>

    <!-- ESAPI security features (prevent sql injection during password change -->
    <dependency>
        <groupId>org.owasp.esapi</groupId>
        <artifactId>esapi</artifactId>
        <version>2.1.0.1</version>
        <exclusions>
            <!--<exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>-->
            <!--<exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>-->
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>${quartz.version}</version>
    </dependency>
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz-jobs</artifactId>
        <version>${quartz.version}</version>
    </dependency>


</dependencies>