graylog-labs / syslog4j-graylog2

The syslog4j fork from Graylog2. This is used since 0.10.0. The original code was very "special" and no actions were taken to improve it. This is planned to be replaced completely in future versions.
GNU Lesser General Public License v2.1
32 stars 40 forks source link

Support jna 4 #19

Closed lbeuster closed 7 years ago

lbeuster commented 7 years ago

Hi,

I tried out the syslog4j with unix-sockets on an arm-linux. Unfortunately the jna 3 impl doesn't support arm. And it was not possible to just change the dependency to jna 4 because the syslog4j class SocketAddr needed a change (only one line - and I didn't really know what I was doing ;)).

@Override
protected List getFieldOrder() {
    return Arrays.asList("sun_family", "sun_path");
}

Without the change there was the following error:

java.lang.Error: Structure.getFieldOrder() on class org.graylog2.syslog4j.impl.unix.socket.UnixSocketSyslog$SockAddr does not provide enough names [0] ([]) to match declared fields [2] ([sun_family, sun_path])
    at com.sun.jna.Structure.getFields(Structure.java:1015)
    at com.sun.jna.Structure.deriveLayout(Structure.java:1172)
    at com.sun.jna.Structure.calculateSize(Structure.java:1097)
    at com.sun.jna.Structure.allocateMemory(Structure.java:390)
    at com.sun.jna.Structure.ensureAllocated(Structure.java:366)
    at com.sun.jna.Structure.ensureAllocated(Structure.java:356)
    at com.sun.jna.Structure.size(Structure.java:423)
    at org.graylog2.syslog4j.impl.unix.socket.UnixSocketSyslog.connect(UnixSocketSyslog.java:109)

Are there any plans to support jna 4?

Best regards Lars

joschi commented 7 years ago

Are there any plans to support jna 4?

No, there are currently no plans to support JNA 4.x or work on the server parts of this library at all. Graylog is only using some isolated parts (e. g. parsing) and we have not interest in maintaining the unused parts.

You might want to check out other forks of this library, e. g. https://github.com/NessComputing/syslog4j.