logging

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 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 AppRunnerServiceLogger added in v1.22.0

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

AppRunnerServiceLogger retrieves the logs of an AppRunner service.

func NewAppRunnerServiceLogger added in v1.22.0

func NewAppRunnerServiceLogger(opts *NewAppRunnerServiceLoggerOpts) (*AppRunnerServiceLogger, error)

NewAppRunnerServiceLogger returns an AppRunnerServiceLogger for the service under env and app.

func (*AppRunnerServiceLogger) WriteLogEvents added in v1.22.0

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

WriteLogEvents writes service logs.

type ECSServiceLogger added in v1.22.0

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

ECSServiceLogger retrieves the logs of an Amazon ECS service.

func NewECSServiceClient added in v1.22.0

func NewECSServiceClient(opts *NewWorkloadLoggerOpts) *ECSServiceLogger

NewECSServiceClient returns an ECSServiceClient for the service under env and app.

func (*ECSServiceLogger) WriteLogEvents added in v1.22.0

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

WriteLogEvents writes service logs.

type HumanJSONStringer

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

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

type JobLogger added in v1.22.0

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

JobLogger retrieves the logs of a job.

func NewJobLogger added in v1.22.0

func NewJobLogger(opts *NewWorkloadLoggerOpts) *JobLogger

NewJobLogger returns an JobLogger for the job under env and app.

func (*JobLogger) WriteLogEvents added in v1.22.0

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

WriteLogEvents writes job logs.

type NewAppRunnerServiceLoggerOpts added in v1.22.0

type NewAppRunnerServiceLoggerOpts struct {
	*NewWorkloadLoggerOpts
	ConfigStore describe.ConfigStoreSvc
}

NewAppRunnerServiceLoggerOpts contains fields that initiate AppRunnerServiceLoggerOpts struct.

type NewWorkloadLoggerOpts added in v1.22.0

type NewWorkloadLoggerOpts struct {
	App  string
	Env  string
	Name string
	Sess *session.Session
}

NewWorkloadLoggerOpts contains fields that initiate workloadLogger struct.

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
	// OnEvents is a handler that's invoked when logs are retrieved from the service.
	OnEvents func(w io.Writer, logs []HumanJSONStringer) error
	LogGroup string

	// Job specific options.
	IncludeStateMachineLogs bool
	// LogStreamLimit is an optional parameter for jobs and tasks to speed up CW queries
	// involving multiple log streams.
	LogStreamLimit int

	// ECS specific options.
	ContainerName string
	TaskIDs       []string
}

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