Paul Smith wrote:
> > v1.3 is
> > going to have a
> > SocketReceiver (matching SocketAppender), SocketHubReceiver (matching
> > SocketHubAppender), JMSReceiver (matching JMSAppender), and
> > maybe more as
> > makes sense.
>
> That's very much what I was thinking, but I hadn't thought about the even
> more generic case of a Receiver, which you have.  Wow, that is cool.

I probably should have mentioned that SocketReceiver, SocketHubReceiver, and
JMSReceiver are all currently implemented and available in the cvs.  Test
cases need to be written, but I have done some basic tests with
SocketReceiver to make sure they are basically functional.  So, if you want
to give them a try, feel free.

Here is a configuration example for SocketAppender/SocketReceiver.

The configuration for the event source:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">
    <appender name="socketout" class="org.apache.log4j.net.SocketAppender">
        <param name="RemoteHost" value="localhost"/>
        <param name="Port" value="5000"/>
        <param name="ReconnectionDelay" value="500"/>
    </appender>

    <root>
        <level value="debug"/>
        <appender-ref ref="socketout" />
    </root>
</log4j:configuration>

The configuration for the event "sink":

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">
    <!--
    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{ABSOLUTE} %c{1}:
%m%n"/>
        </layout>
    </appender>
    -->

    <appender name="A1" class="org.apache.log4j.FileAppender">
        <param name="File"   value="output/filters.PluginsTest.txt" />
        <param name="Append" value="false" />

        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{ABSOLUTE} %c: %m%n"/>
        </layout>
    </appender>

    <plugin name="SocketReceiver"
class="org.apache.log4j.net.SocketReceiver">
        <param name="Port" value="5000"/>
    </plugin>

    <root>
        <level value="debug"/>
        <appender-ref ref="A1" />
    </root>
</log4j:configuration>

Remote and local events will all get appended to the FileAppender, "A1", on
the "sink" side.  Now imagine that there was also a ChainsawAppender defined
in the sink xml.  You could define a configuration file that defined
recievers for different remote sources and different remote appender types,
all feeding into the ChainsawAppender for display.  LF5 already does its
appender this way.

-Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to