On Tue, Mar 27, 2012 at 3:18 PM, david@lang.hm wrote:
I posted some of this at the bottom of a long message yesterday that nobody replied to, so I broke it out to a separate thread
The traditional syslog interface has been a write-only interface, with the only feedback being that the write could block.
With the new formats and new syslog replacement library, does there need to be some rethinking of this interface?
JSON can be pushed through the traditional syslog interface with no changes (which is one of the attractions of using JSON), but when we support additional formats, especially ones with type information, we need to have a way to tell what format to use when writing the log.
I don't think this is right approach. The end goal is to support structured log messages. The first step is to introduce the capability to sent structured events via existing capabilities (read: JSON over Syslog)
The next steps would be the ELAPI/selog API that would introduce a new logging interface, probably maintaining at least minimal compatibility with the syslog daemon (not the syslog API or syslog protocol). This would allow us to define and support more feature-rich log protocols and other features.
This could be done by configuring things in the openlog call, but that requries changes to every application.
I think it would be better to have the serialization format be determined automatically by the library if possible.
One way to do this is to have a handshake.
When a app opens /dev/log, the syslog server sends a capabilities message.
The client can ignore this message and send traditional formatted syslog data to the server
Or, the client can read the capabilities message and then pick which supported format (potentially with compression options) to use to send data to the server.
This approach lets the format be anything that the library supports, under the control of the sysadmin of the system (by configuring what capabilities the syslog daemon advertises) without the application programmer needing to know anything about these formats.
thoughts?
Let's not get ahead of ourselves and try to shoehorn a solution into existing/legacy capabilities. We should approach this as a two-pronged solution:
1. Backwards-compatible structured log implementation that works with the syslog API and syslog protocol (this is umberlog). This should be as minimal and compatible as possible. I commend Gergely on his implementation
2. Implement a new event API frontend and improved logging capabilities. This should be able to work with syslogd, but does not have any requirements to be able to work with the existing syslog API, syslog protocol, /dev/log, etc.