...

Package jsonlog

import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog"
Overview
Index

Overview ▾

type JSONLog

JSONLog is a log message, typically a single entry from a given log stream.

type JSONLog struct {
    // Log is the log message
    Log string `json:"log,omitempty"`
    // Stream is the log source
    Stream string `json:"stream,omitempty"`
    // Created is the created timestamp of log
    Created time.Time `json:"time"`
    // Attrs is the list of extra attributes provided by the user
    Attrs map[string]string `json:"attrs,omitempty"`
}

func (*JSONLog) Reset

func (jl *JSONLog) Reset()

Reset all fields to their zero value.

type JSONLogs

JSONLogs marshals encoded JSONLog objects

type JSONLogs struct {
    Log     []byte    `json:"log,omitempty"`
    Stream  string    `json:"stream,omitempty"`
    Created time.Time `json:"time"`

    // json-encoded bytes
    RawAttrs json.RawMessage `json:"attrs,omitempty"`
}

func (*JSONLogs) MarshalJSONBuf

func (mj *JSONLogs) MarshalJSONBuf(buf *bytes.Buffer) error

MarshalJSONBuf is an optimized JSON marshaller that avoids reflection and unnecessary allocation.