Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In theory it's possible. Now how difficult in practice it might be depends on whether Java serialization format is documented or not. I guess, it's not. <strong>edit:</strong> <a href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf" rel="nofollow noreferrer">oops, I was wrong, thanks Charles</a>.</p> <p><strong>Anyway, this is what I suggest you to do</strong></p> <ol> <li><p>capture from log4j &amp; deserialize Java object in your own little Java program.</p></li> <li><p>now when you have the object again, serialize it using your own custom formatter. </p> <p><strong><em>Tip:</strong> Maybe you don't even have to write your own custom formatter. for example, <a href="http://www.json.org/" rel="nofollow noreferrer">JSON (scroll down for libs)</a> has libraries for Python and Java, so you could in theory use Java library to serialize your objects and Python equivalent library to deserialize it</em></p></li> <li><p>send output stream to your python application and deserialize it</p></li> </ol> <blockquote> <p><strong>Charles wrote:</strong></p> <p>the problem is that for this to work, your "little java program" needs to load the same versions of all the same classes that it might deserialize. Which is tricky if you're receiving log messages from one app, and really tricky if you're multiplexing more than one log stream. Either way, it's not going to be a little program any more.</p> </blockquote> <p>Can't you just simply reference Java log4j libraries in your own java process? I'm just giving general advice here that is applicable to any pair of languages (name of the question is pretty language agnostic so I just provided one of the generic solutions). Anyway, I'm not familiar with log4j and don't know whether you can "inject" your own serializer into it. If you can, then of course your suggestion is much better and cleaner.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload