logs

package
v0.0.0-...-11f2a26 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a logs client for DC/OS.

func NewClient

func NewClient(baseClient *httpclient.Client, out io.Writer) *Client

NewClient creates a new logs client.

func (*Client) FollowTask

func (c *Client) FollowTask(taskID string, file string, printLogs bool, opts Options) error

FollowTask follows a task's logs.

func (*Client) PrintComponent

func (c *Client) PrintComponent(route string, service string, opts Options) error

PrintComponent prints a component's logs.

func (*Client) PrintTask

func (c *Client) PrintTask(taskID string, file string, opts Options) error

PrintTask prints a task's logs.

type Entry

type Entry struct {
	Fields             EntryFields `json:"fields"`
	Cursor             string      `json:"cursor"`
	MonotonicTimestamp int64       `json:"monotonic_timestamp"`
	RealtimeTimestamp  int64       `json:"realtime_timestamp"`
}

Entry refers to a DC/OS log entry.

func (*Entry) JournalctlJSON

func (e *Entry) JournalctlJSON() JournalctlJSONEntry

JournalctlJSON generates a journalctl JSON log entry from a DC/OS log entry.

type EntryFields

type EntryFields struct {
	Message          string `json:"MESSAGE"`
	Priority         string `json:"PRIORITY"`
	SyslogFacility   string `json:"SYSLOG_FACILITY"`
	SyslogIdentifier string `json:"SYSLOG_IDENTIFIER"`
	BootID           string `json:"_BOOT_ID"`
	CapEffective     string `json:"_CAP_EFFECTIVE"`
	Cmdline          string `json:"_CMDLINE"`
	Comm             string `json:"_COMM"`
	Exe              string `json:"_EXE"`
	GID              string `json:"_GID"`
	Hostname         string `json:"_HOSTNAME"`
	MachineID        string `json:"_MACHINE_ID"`
	PID              string `json:"_PID"`
	SelinuxContext   string `json:"_SELINUX_CONTEXT"`
	StreamID         string `json:"_STREAM_ID"`
	SystemdCgroup    string `json:"_SYSTEMD_CGROUP"`
	SystemdSlice     string `json:"_SYSTEMD_SLICE"`
	SystemdUnit      string `json:"_SYSTEMD_UNIT"`
	Transport        string `json:"_TRANSPORT"`
	UID              string `json:"_UID"`
}

EntryFields are the fields in a DC/OS log entry.

type JournalctlJSONEntry

type JournalctlJSONEntry struct {
	Cursor             string `json:"__CURSOR"`
	MonotonicTimestamp int64  `json:"__MONOTONIC_TIMESTAMP"`
	RealtimeTimestamp  int64  `json:"__REALTIME_TIMESTAMP"`
	Message            string `json:"MESSAGE"`
	Priority           string `json:"PRIORITY"`
	SyslogFacility     string `json:"SYSLOG_FACILITY"`
	SyslogIdentifier   string `json:"SYSLOG_IDENTIFIER"`
	BootID             string `json:"_BOOT_ID"`
	Hostname           string `json:"_HOSTNAME"`
	MachineID          string `json:"_MACHINE_ID"`
	Transport          string `json:"_TRANSPORT"`
}

JournalctlJSONEntry are the fields that are printed for output=[json, json-pretty].

type Options

type Options struct {
	Filters []string
	Follow  bool
	Format  string
	Skip    int
}

Options encapsulates options that can be set via flags on the command.

Jump to

Keyboard shortcuts

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