cloudlogging

package
v0.0.0-...-05145c8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(p *Processor) error

Option is the option to set up a Cloud Logging processor.

func WithDefaultBestEffort

func WithDefaultBestEffort() Option

WithDefaultBestEffort sets the default logging mode of operation to best effort. There are two possible logging modes of operation:

  • fail-close. Without this option, this is default. The Cloud Logging client blocks to emit a log, and immediately returns an error when there's a failure.
  • best effort. The Cloud Logging client emits logs asynchronously and does not return an error on failure. Calling `Stop()` flushes the logs and returns all previously encountered errors.

TODO(b/203776475): individual log requests can specify failclose or besteffort logging.

func WithLoggingClient

func WithLoggingClient(client *logging.Client) Option

WithLoggingClient provides a Cloud Logging client to the processor.

type Processor

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

Processor is the remote Cloud Logging processor.

func NewProcessor

func NewProcessor(ctx context.Context, opts ...Option) (*Processor, error)

NewProcessor creates a new Cloud Logging log processor with the given options.

func (*Processor) Process

func (p *Processor) Process(ctx context.Context, logReq *api.AuditLogRequest) error

Process emits an audit logs to Cloud Logging synchronously.

func (*Processor) Stop

func (p *Processor) Stop() error

Stop stops the processor by flushing the logs from all loggers. Stop is only meaningful when the client emitted logs as best-effort.

Jump to

Keyboard shortcuts

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