logging

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package logging contains utility functions for ECS logging.

Package logging contains utility functions for ECS logging.

Package logging contains utility functions for ECS logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteHumanLogs

func WriteHumanLogs(w io.Writer, logStringers []HumanJSONStringer) error

WriteHumanLogs outputs CloudWatch logs in human-readable format.

func WriteJSONLogs

func WriteJSONLogs(w io.Writer, logStringers []HumanJSONStringer) error

WriteJSONLogs outputs CloudWatch logs in JSON format.

Types

type HumanJSONStringer

type HumanJSONStringer interface {
	HumanString() string
	JSONString() (string, error)
}

HumanJSONStringer can output in both human-readable and JSON format.

type NewServiceLogsConfig added in v1.7.0

type NewServiceLogsConfig struct {
	App         string
	Env         string
	Svc         string
	Sess        *session.Session
	LogGroup    string
	WkldType    string
	TaskIDs     []string
	ConfigStore describe.ConfigStoreSvc
}

NewServiceLogsConfig contains fields that initiates ServiceClient struct.

type ServiceClient

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

ServiceClient retrieves the logs of an Amazon ECS or AppRunner service.

func NewServiceClient

func NewServiceClient(opts *NewServiceLogsConfig) (*ServiceClient, error)

NewServiceClient returns a ServiceClient for the svc service under env and app. The logging client is initialized from the given sess session.

func (*ServiceClient) WriteLogEvents

func (s *ServiceClient) WriteLogEvents(opts WriteLogEventsOpts) error

WriteLogEvents writes service logs.

type TaskClient

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

TaskClient retrieves the logs of Amazon ECS tasks.

func NewTaskClient

func NewTaskClient(sess *session.Session, groupName string, tasks []*task.Task) *TaskClient

NewTaskClient returns a TaskClient that can retrieve logs from the given tasks under the groupName.

func (*TaskClient) WriteEventsUntilStopped

func (t *TaskClient) WriteEventsUntilStopped() error

WriteEventsUntilStopped writes tasks' events to a writer until all tasks have stopped.

type TasksDescriber

type TasksDescriber interface {
	DescribeTasks(cluster string, taskARNs []string) ([]*ecs.Task, error)
}

TasksDescriber describes ECS tasks.

type WriteLogEventsOpts

type WriteLogEventsOpts struct {
	Follow    bool
	Limit     *int64
	StartTime *int64
	EndTime   *int64
	TaskIDs   []string
	// OnEvents is a handler that's invoked when logs are retrieved from the service.
	OnEvents func(w io.Writer, logs []HumanJSONStringer) error
}

WriteLogEventsOpts wraps the parameters to call WriteLogEvents.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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