0

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'
Stanislav Ivanov
  • 425
  • 2
  • 7
  • 19

2 Answers2

0

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.

Stanislav Ivanov
  • 425
  • 2
  • 7
  • 19
0

Please go through the file log4j2-test.xml It might be on the below pattern.

<Configuration>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%-5p %d [%t] %c: %m%n"/>
        </Console>

        <Logentries >
            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss ZZZ} %-5p: %F:%L  %m"/>
            <Name>le</Name>
            <Token>${logentries.token}</Token>
            <Debug>false</Debug>
            <Ssl>False</Ssl>
        </Logentries>
    </Appenders>
<Loggers>

        <Root level="DEBUG">
            <AppenderRef ref="Console"/>
            <AppenderRef ref="le"/>
        </Root>
    </Loggers>

</Configuration>

Please remove ref="le" and 'Logentries' entry if you are not sure what extra classes need to added or version to be changed.

  • I wrote this question more than an year ago and I do not work on this project anymore. I am sorry, there is no way for me to validate your response. – Stanislav Ivanov Aug 18 '16 at 12:00