Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultTemplate = "{{.ID}}"
DefaultTemplate defines the defaults template logger should use.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder interface { // Reset resets the decoder // Reset is called for certain events, such as log rotations Reset(io.Reader) // Decode decodes the next log message from the stream Decode() (*logger.Message, error) // Close signals to the decoder that it can release whatever resources it was using. Close() }
Decoder is for reading logs It is created by the log reader by calling the `MakeDecoderFunc`
type GetTailReaderFunc ¶
type GetTailReaderFunc func(ctx context.Context, f SizeReaderAt, nLogLines int) (rdr SizeReaderAt, nLines int, err error)
GetTailReaderFunc is used to truncate a reader to only read as much as is required in order to get the passed in number of log lines. It returns the sectioned reader, the number of lines that the section reader contains, and any error that occurs.
type LogFile ¶
type LogFile struct {
// contains filtered or unexported fields
}
LogFile is Logger implementation for default Docker logging.
func NewLogFile ¶
func NewLogFile(logPath string, capacity int64, maxFiles int, compress bool, decodeFunc MakeDecoderFn, perms os.FileMode, getTailReader GetTailReaderFunc) (*LogFile, error)
NewLogFile creates new LogFile
func (*LogFile) ReadLogs ¶
func (w *LogFile) ReadLogs(ctx context.Context, config logger.ReadConfig) *logger.LogWatcher
ReadLogs decodes entries from log files.
It is the caller's responsibility to call ConsumerGone on the LogWatcher.
Click to show internal directories.
Click to hide internal directories.