Search code examples
mulemule-studiolog4j2logentries

Mule 3.6.1 and Logentries using log4j2


We are building our application with Mule 3.6.1. In order to overwrite their log, we need to use log4j2.xml. I followed the example for making one here: https://logentries.com/doc/java/. When I run our application I am getting:

2015-05-06 09:56:37,603 ERROR Error processing element Logentries: CLASS_NOT_FOUND

2015-05-06 09:56:37,606 ERROR Unable to locate appender le for logger

This makes me wonder if I am missing something. I am not sure what those steps mean actually:

  • (1) Install Log4j2 (if you are not already using it).
  • (2) Install the Logentries appender.
  • (3) Configure the Logentries appender.

Those are descibed only for log4j2 and not for log4j or logback. I tried log4j and logback as descibed https://logentries.com/doc/java/ from a general Eclipse project and they both worked. However, in the general Eclipse project log4j2 didnt work. There should be some special setting that I am missing but I cant really see what on Apaches site.

This is how our Gradle looks like:

dependencies {
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.2'
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.6.4'
compile group: 'com.logentries', name: 'logentries-appender', version: 'RELEASE'
compile group: 'log4j', name: 'log4j', version: '1.2.16'


Solution

  • Actually, I found out what was wrong. The problem was here:

    compile group: 'com.logentries', name: 'logentries-appender', version: 'RELEASE'

    This downloaded the following jar: file:/C:/Projects/tralala/.mule/apps/ws-comaround-cfx/lib/logentries-appender-1.1.20.jar which do not include the support for log4j2! I had to change to

    compile group: 'com.logentries', name: 'logentries-appender', version: '1.1.30'

    1.1.30 version includes the log4j2 support. Interesting why RELEASE as version do not work though. I tried it also in Eclipse and changing the version there worked also fine.