I just tried it myself with the latest developer snapshot and it worked fine.

This code was used on the 'transmit' side:

    SocketHandler socketHandler = new SocketHandler("localhost", 2222);
    logger.addHandler(socketHandler);
    socketHandler.setLevel(Level.ALL);
    logger.setLevel(Level.ALL);

This config file was my entire Chainsaw config (started on same
machine of course):

<?xml version="1.0" encoding="UTF-8"?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">
   <plugin name="XMLSocketReceiver"
class="org.apache.log4j.net.XMLSocketReceiver">
      <param name="decoder" value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/>
      <param name="Port" value="2222"/>
   </plugin>
   <root>
      <level value="debug"/>
   </root>
</log4j:configuration>

The levels fine/finer/finest showed up fine, and the message and
timestamp displayed, even throwable showed up fine.

Events should route to their own tab, see the 'application-wide
preferences', general, tab name/event routing expression field.  By
default the 'hostname' and 'application' fields are used to route
events to unique tabs.  Application isn't set, but hostname should be
'localhost', so events should go to a 'localhost' tab.

You can right-click in a table and go to tab preferences and select
displayed columns.

The tutorial is most of the documentation we have (available from the
help menu), but the 'tab routing' expression is based on fields found
in the log event itself, which is why 'hostname' is set to localhost
for the socket handler events.  You could change that expression to
'level' to get individual tabs for info/debug/warn level messages,
etc.

I hope that helps,

Scott




On 5/16/16, Ray Tayek <rta...@ca.rr.com> wrote:
> On 5/16/2016 2:26 PM, Scott Deboy wrote:
>> With the latest developer snapshot from http://people.apache.org/~sdeboy
>>
>> See the 'Welcome' tab in Chainsaw, and click 'View example Receiver
>> Configuration' toolbar button.
>>
>> Copy and paste that to a file, and remove all of the plugin entries except
>> for:
>>
>>   <plugin name="XMLSocketReceiver"
>> class="org.apache.log4j.net.XMLSocketReceiver">
>>        <param name="decoder"
>> value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/>
>>        <param name="Port" value="2222"/>
>>     </plugin>
>>
>> And modify that port to match what you need, and save as
>> chainsaw-config-util-logging-socket.xml or something like that.
>>
>> Then, in Chainsaw, select File, Load Chainsaw configuration, use a
>> Chainsaw config file, open file, browse to that
>> chainsaw-config-util-logging-socket.xml file, and click ok.
>>
>> You should start seeing your events show up in the UI.
> tried that with the attached file. but it just says: 56 - 2016/05/16
> 15:53:09 -  - INFO - org.apache.log4j.chainsaw.messages.MessageCenter -
> getXMLFileAppenderConfiguration for file:
> C:\Users\ray\Documents\chainsawconfig.xml, result: {}
>
> i tried using this file with my older version (2.1) and it started the
> socket, and i am seeing lots of messages! (thank you)
>
> but the messages are not expanded, as they are in the chainsaw log tab
> (there are only 3 columns: application, hostname, and
> log4j.remoteSourceInfo).
>
> is there a way to make the messages show up with the usual column
> headings like the pic <https://logging.apache.org/chainsaw/> in the doc?
>
> it says my buffer is full, is there a way to store these as files and
> roll them over at some point?
>
> doc says: *Tabs/Docking* - Chainsaw routes separate applications/remote
> hosts' events to a unique Tab within the GUI. These tabs can be undocked
> from the main window. Using these features you can manage multiple
> application logs using the one GUI. can you point me to the doc on this?
>
> thanks
>
>
>
>
>
>
>> On 5/16/16, Ray Tayek <rta...@ca.rr.com> wrote:
>>> hi,  please excuse me if this is the wrong place to post, but i am new
>>> to log4j and chainsaw.
>>>
>>> i posted this question
>>> <http://stackoverflow.com/questions/37239400/apache-chainsaw-v2-gets-bind-exception-or-connection-lost-invalid-stream-he>,
>>>
>>> but have no results yet.
>>>
>>> jigsaw seems kinda dead, is this what people still use to monitor logs
>>> from socket handlers or should i look at something more recent?
>>>
>>> any pointers will be appreciated.
>>>
>>> thanks
>>>
>>> --
>>> Honesty is a very expensive gift. So, don't expect it from cheap people
>>> -
>>> Warren Buffett
>>> http://tayek.com/
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>
>>
>
>
> --
> Honesty is a very expensive gift. So, don't expect it from cheap people -
> Warren Buffett
> http://tayek.com/
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to