Skip to content

Log formatting in shim #603

@ibuildthecloud

Description

@ibuildthecloud

As discussed at the containerd summit, many people agree that adding log driver capabilities to containerd seems useful. Having thought about this some, there are two major drawbacks that have been brought up. 1) shim is already part of a plug-in, so adding plug-ins to a plug-in is a bit odd. 2) log drivers could be extremely expensive and burdensome to add to the shim. Following the suggestion of @thockin maybe we should look at a simpler approach of having a format flag.

When you think about it, the majority of log drivers are just shipping content elsewhere. From that perspective containerd could just write to a file and driver read the file. The fundamental downside here is that you lose the context of when the data was written. So the key thing missing here is just the timestamp. What I propose is that the shim take one arguement for "--structured-output."

If true: shim reads from process stdout/err, formats data into timestamped segments, writes to passed in file or fifo.
If false: shim reads from process stdout/err writes to passed in file or fifo.

The key thing here is to decide on a standard format. I don't know if I'd want to do a fmt style configuration but instead pick some efficient binary format. Even json is not so efficient as you have to reencode the data as a string. I'm not a serialization format expert, but maybe a simple protobuf structure could do? Something that would be as close to "TIMESTAMP", "DATA LENGTH", "DATA".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions