logger

package module
v0.0.0-...-332d064 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2016 License: MIT Imports: 18 Imported by: 0

README

cloudwatchlogs-agent

AWS CloudWatch Logs Agent written in Go with zero runtime dependencies optimized to run within Boxfuse instances.

This agent is released under the The MIT License (MIT).

It is based on the original Go agent by Jason Mooberry (which unfortunately is not available online anymore).

Documentation

Index

Constants

View Source
const (
	MaxMessageLength = 32 << 10
)

Variables

View Source
var (
	// this is how long a batch will continue to be retried, in the event CloudWatch is
	// not available.  At which point the batch is dumped to stderr
	MaxRetryTime = time.Hour

	// the buffer length of the log event channel
	EventLogBufferLength = 64 << 10

	// this occurs when the buffered channel receiving log writes blocks
	ErrStreamBackedUp = errors.New("stream backed up")
)
View Source
var (
	ExceededBufferSizeLimitError = fmt.Errorf("exceeded buffer size limit")
	WriterClosedError            = fmt.Errorf("cannot write to closed writer")
)
View Source
var (
	MaxSleepInterval = 10 * time.Second
	ErrMaxTries      = errors.New("max tries")
)

Functions

This section is empty.

Types

type LogMessage

type LogMessage struct {
	Instance *string `json:"instance"`
	Image    *string `json:"image"`
	Level    *string `json:"level"`
	Message  *string `json:"message"`
}

type Logger

type Logger struct {

	// Service exposed for direct actions
	Service *cloudwatchlogs.CloudWatchLogs
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(sess *session.Session, endpoint, group, stream, level string, flushInterval time.Duration, image, instance string, x *bool) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Write

func (l *Logger) Write(b []byte) (int, error)

func (*Logger) WriteError

func (l *Logger) WriteError(err error) error

func (*Logger) WriteJSON

func (l *Logger) WriteJSON(v interface{}) error

func (*Logger) WriteRoundTrip

func (l *Logger) WriteRoundTrip(resp *http.Response, duration time.Duration) error

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

func NewRateLimiter

func NewRateLimiter(n int, d time.Duration) *RateLimiter

func (*RateLimiter) Close

func (r *RateLimiter) Close()

func (*RateLimiter) Ready

func (r *RateLimiter) Ready() bool

type ScannerWriter

type ScannerWriter struct {
	// contains filtered or unexported fields
}

func NewScannerWriter

func NewScannerWriter(splitFunc bufio.SplitFunc, max_buf int, tokenFunc func([]byte) error) *ScannerWriter

func (*ScannerWriter) Close

func (sc *ScannerWriter) Close() error

func (*ScannerWriter) Flush

func (sc *ScannerWriter) Flush() error

func (*ScannerWriter) Write

func (sc *ScannerWriter) Write(data []byte) (int, error)

type Trier

type Trier struct {
	// contains filtered or unexported fields
}

func NewTrier

func NewTrier(maxTotalTime time.Duration) *Trier

func (*Trier) Try

func (t *Trier) Try() bool

func (*Trier) TryFunc

func (t *Trier) TryFunc(f func() (error, bool)) error

func (*Trier) Wait

func (t *Trier) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL