Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
LogConfig map[string]string
ContainerID string
ContainerName string
ContainerImageID string
ContainerEnvs []string
ContainerLabels map[string]string
ContainerRootDir string
DaemonName string
}
Info provides container information for log driver.
TODO(fuwei): add more fields.
func (*Info) ExtraAttributes ¶
ExtraAttributes returns the user-defined extra attributes (labels, environment variables) in key-value format.
NOTE: This can be used by log-driver which support metadata in log file.
func (*Info) ImageFullID ¶
ImageFullID returns the container's image ID.
type LogCopier ¶
LogCopier is used to copy data from stream and write it into LogDriver.
func NewLogCopier ¶
NewLogCopier creates copier for logger.
type LogDriver ¶
type LogDriver interface {
Name() string
WriteLogMessage(msg *LogMessage) error
Close() error
}
LogDriver represents any kind of log drivers, such as jsonfile, syslog.
type LogMessage ¶
type LogMessage struct {
Source string // Source means stdin, stdout or stderr
Line []byte // Line means the log content, but it maybe partial
Timestamp time.Time // Timestamp means the created time of line
Attrs map[string]string
Err error
}
LogMessage represents the log message in the container json log.
type LogMode ¶
type LogMode string
LogMode indicates available logging modes.
const ( // LogModeDefault default to unuse buffer to make logs blocking. LogModeDefault = "" // LogModeBlocking means to unuse buffer to make logs blocking. LogModeBlocking LogMode = "blocking" // LogModeNonBlock means to use buffer to make logs non blocking. LogModeNonBlock LogMode = "non-blocking" )
type LogWatcher ¶
type LogWatcher struct {
Msgs chan *LogMessage
Err chan error
// contains filtered or unexported fields
}
LogWatcher is used to pass the log message to the reader.
func (*LogWatcher) WatchClose ¶
func (w *LogWatcher) WatchClose() <-chan struct{}
WatchClose returns the close notifier.