0

I am trying to stream some logging messages from an application that is a bit of a black box to me. It is packaged with commons-logging-1.0.4.jar and is using log4j underneath it. I am trying to stream one of the loggers so I can view it in chainsaw. I can direct the log messages to a file without a problem, but when I configure a socket appender I never see the connection accepted in the chainsaw log. I can telnet to port 4560 on the host running chain saw and will then see that connection accepted. I can't figure out what is mis-configured and am starting to wonder if this feature does not work with commons-logging. Here is the configuration snippet from the log4j.xml configuration. Is there something mis-configured that I don't understand?

   <appender name="SOCKET" class="org.apache.logging.log4j.core.appender.SocketAppender">
            <param name="RemoteHost" value="ljgaer"/>
            <param name="Port" value="4560"/>
    </appender>
    <appender name="FILE2" class="org.apache.log4j.RollingFileAppender">
            <param name="File" value="/tmp/test.log" />
            <param name="MaxFileSize" value="50MB" />
            <param name="MaxBackupIndex" value="10" />
            <layout class="org.apache.log4j.PatternLayout">
                    <param name="ConversionPattern" value="###########MSG%n%m%n" />
            </layout>
    </appender>

    <!-- Change level to ALL to turn on xml logging.  -->
    <logger name="XMLLogger" additivity="false">
            <level value="ALL" />
            <appender-ref ref="SOCKET" />
            <appender-ref ref="FILE2" />
    </logger>
Jeff Gaer
  • 134
  • 1
  • 11

1 Answers1

0

Turns out the package name for the socket appender was wrong.

should have been

org.apache.log4j.net.SocketAppender

Jeff Gaer
  • 134
  • 1
  • 11