log

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const JournaldTimeLayout = "2006-01-02 15:04:05"

JournaldTimeLayout custom go time layouts must match the reference time Jan 2 15:04:05 2006 MST

Variables

This section is empty.

Functions

func DockerLogCmd

func DockerLogCmd(container, destDir string, since time.Time) string

Types

type Docker

type Docker struct {
	// Container is the name of the docker container to get logs from
	Container string `json:"container"`
	// DestDir is the directory we will write the logs to
	DestDir string `json:"destDir"`
	// Since marks the beginning of the time range to include logs
	Since      time.Time        `json:"since"`
	Redactions []*redact.Redact `json:"redactions"`
}

Docker allows logs to be retrieved for a docker container

func NewDocker

func NewDocker(container, destDir string, since time.Time, redactions []*redact.Redact) *Docker

NewDocker returns a runner with an identifier and fully configured docker runner

func (Docker) ID

func (d Docker) ID() string

func (Docker) Run

func (d Docker) Run() op.Op

Run executes the runner

type DockerNoLogsError

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

func (DockerNoLogsError) Error

func (e DockerNoLogsError) Error() string

type DockerNotFoundError

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

func (DockerNotFoundError) Error

func (e DockerNotFoundError) Error() string

func (DockerNotFoundError) Unwrap

func (e DockerNotFoundError) Unwrap() error

type Journald

type Journald struct {
	Service    string           `json:"service"`
	DestDir    string           `json:"destDir"`
	Since      time.Time        `json:"since"`
	Until      time.Time        `json:"until"`
	Redactions []*redact.Redact `json:"redactions"`
}

func NewJournald

func NewJournald(service, destDir string, since, until time.Time, redactions []*redact.Redact) *Journald

NewJournald sets the defaults for the journald runner

func (Journald) ID

func (j Journald) ID() string

func (Journald) LogsCmd

func (j Journald) LogsCmd() string

LogsCmd arranges the params into a runnable command string.

func (Journald) Run

func (j Journald) Run() op.Op

Run attempts to pull logs from journald via shell command, e.g.: journalctl -x -u {name} --since '3 days ago' --no-pager > {destDir}/journald-{name}.log

type JournaldNotFound

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

func (JournaldNotFound) Error

func (e JournaldNotFound) Error() string

func (JournaldNotFound) Unwrap

func (e JournaldNotFound) Unwrap() error

type JournaldPermissionError

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

func (JournaldPermissionError) Error

func (e JournaldPermissionError) Error() string

func (JournaldPermissionError) Unwrap

func (e JournaldPermissionError) Unwrap() error

type JournaldServiceNotEnabled

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

func (JournaldServiceNotEnabled) Error

func (JournaldServiceNotEnabled) Unwrap

func (e JournaldServiceNotEnabled) Unwrap() error

Jump to

Keyboard shortcuts

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