Chainsaw v2 SocketReceiver not working with log4j2 SocketAppender

1.1k Views Asked by At

I'm trying to use Chainsaw v2 from http://people.apache.org/~sdeboy I don't want to use zero configuration. Just a simple socketAppender/SocketReceiver combo.

I'm using log4j2 with the following configuration

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" >
    <Appenders>
        <Console name="CONSOLE" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
        </Console>
        <Socket name="SharathZeroConf" host="localhost" port="4445">
        </Socket>
    </Appenders>
    <Loggers>
        <Root level="debug">
            <AppenderRef ref="SharathZeroConf" />
            <AppenderRef ref="CONSOLE" />
        </Root>

    </Loggers>
</Configuration>

On ChainSaw, I'm selecting the option "Receive events from network" with port 4445.

However chainsaw doesnt log anything.

I've verified that the appender configuration is correct on log4j side by using the builtin socketserver

java -cp ~/.m2/reposiry/org/apache/logging/log4j/log4j-api/2.0.2/log4j-api-2.0.2.jar  org.apache.logging.log4j.core.net.server.TcpSocketServer 4445

So the bug must be on chainsaw side. Any pointers @Scott ?

1

There are 1 best solutions below

3
xav On

You're right, I got the same issue. I just tried with LogMX instead, and it works like a charm:

LogMX screenshot

I just had to copy Log4j JARs in LogMX lib/ directory (i.e. log4j-api-2.xx.jar and log4j-core-2.xx.jar)