MCPcopy Create free account
hub / github.com/containerd/nerdctl / WriteLogEntry

Method WriteLogEntry

pkg/logging/json_logger.go:135–137  ·  view source on GitHub ↗

WriteLogEntry writes a single log line synchronously, implementing SyncDriver. Writing inline (rather than over a channel consumed by Process) ensures a container's final output is durable before containerd tears the logging process down on exit. https://github.com/containerd/nerdctl/issues/5006

(stream, line string)

Source from the content-addressed store, hash-verified

133// container's final output is durable before containerd tears the logging
134// process down on exit. https://github.com/containerd/nerdctl/issues/5006
135func (jsonLogger *JSONLogger) WriteLogEntry(stream, line string) error {
136 return jsonLogger.encoder.Encode(stream, line)
137}
138
139func (jsonLogger *JSONLogger) PostProcess() error {
140 return nil

Callers

nothing calls this directly

Calls 1

EncodeMethod · 0.80

Tested by

no test coverage detected