fyi, I've already broken this out into a distinct repo here This is where I'm documenting all the shit I went through in learning enough java to get this zeromq appender modified.
I'm currently modifying the logcentric ZMQAppender to add some functionality:
- configurable socket pair type (push and pub right now)
- configurable bind vs. connect
- topics on pub sockets
- socket identity (not critical right now)
Eventually I want to add properties that add additional fields to the json that gets sent. I also want to make the endpoint accept multiple hosts.
Last step is to break everything OUT of logcentric and into a standalone project. All I need is a ZeroMQ appender that spits out JSON.
Gotchas I've run into
- log4j doesn't like underscores in property names
- evidently the order in which you compare strings with
.equalsmatters and can throw an NPE with the wrong order
Building the test sender
cd foo; javac -cp ../classes/log4j-1.2.16.jar Log4jExample.java
cd ..; jar cvf foo.jar foo/*.class
Just need something listening with the right socket pair and port
Building jzmq on OSX sucks. Right now I'm compiling logcentric locally and copying the artifact up to a remote linux host where I'm running the sender.
the code to build the jar is here:
It works fairly well right now, surprisingly.... could use some help ;)