[zeromq-dev] Logging format for sys://log transport

Chuck Remes cremes.devlist at mac.com
Mon Nov 15 21:40:41 CET 2010

On Nov 15, 2010, at 2:30 PM, Mikko Koppanen wrote:

> Hello,
> short background (and correct me if something is wrong here):
> The sys://log transport is an internal transport, a PUB socket
> providing logging information on what happens inside 0MQ. The
> information has not yet been defined but probably contains things such
> as severity, event type and message associated with the event.
> The question is how structure this information in the most effective
> way? One way would be to use severity as the topic and allow user to
> subscribe to all events above let's say level warning but this still
> leaves the question about the data format inside the message. My
> current thinking leans on something like:
> struct zmq_event_t {
>    uint8_t severity;
>    uint16_t type;
>    char *message;
> };
> where type could be something like ZMQ_EVENT_CONNECT,
> However this probably doesn't include all possible use-cases so it
> would be nice to hear ideas on what would be the best way to organise
> this information.

I suggest we take advantage of multi-part messages to subdivide the data rather than define an explicit C struct. For example, the topic *must* be the first message part, type could be the second and the message description could be the 3rd message part.

The current subscription logic doesn't allow us to get very sophisticated and filter by severity OR type. We have to pick one, so severity is probably the right choice. The subscription filter logic also doesn't allow for hierarchical subscriptions (FATAL *and* ERROR *and* WARNING, but *not* INFO or DEBUG). It is doing a simple byte pattern match. I don't have any ideas on how to solve this problem other than to make the filtering more complex to allow regex or similar.


More information about the zeromq-dev mailing list