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 ¶
HumanJSONStringer can output in both human-readable and JSON format.
type NewWorkloadLogsConfig ¶ added in v1.20.0
type NewWorkloadLogsConfig struct { App string Env string Name string Sess *session.Session LogGroup string WkldType string TaskIDs []string ConfigStore describe.ConfigStoreSvc IncludeStateMachineLogs bool }
NewWorkloadLogsConfig contains fields that initiates WorkloadClient struct.
type TaskClient ¶
type TaskClient struct {
// contains filtered or unexported fields
}
TaskClient retrieves the logs of Amazon ECS tasks.
func NewTaskClient ¶
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 WorkloadClient ¶ added in v1.20.0
type WorkloadClient struct {
// contains filtered or unexported fields
}
WorkloadClient retrieves the logs of an Amazon ECS or AppRunner service.
func NewWorkloadClient ¶ added in v1.20.0
func NewWorkloadClient(opts *NewWorkloadLogsConfig) (*WorkloadClient, error)
NewWorkloadClient returns a WorkloadClient for the svc service under env and app. The logging client is initialized from the given sess session.
func (*WorkloadClient) WriteLogEvents ¶ added in v1.20.0
func (s *WorkloadClient) WriteLogEvents(opts WriteLogEventsOpts) error
WriteLogEvents writes service logs.
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 // LogStreamLimit is an optional parameter for jobs and tasks to speed up CW queries // involving multiple log streams. LogStreamLimit int }
WriteLogEventsOpts wraps the parameters to call WriteLogEvents.