log: github.com/apex/log/handlers/apexlogs Index | Files

package apexlogs

import "github.com/apex/log/handlers/apexlogs"

Package apexlogs implements a handler for Apex Logs https://apex.sh/logs/.

Index

Package Files

apexlogs.go

type Handler Uses

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

Handler implementation.

func New Uses

func New(url, projectID, authToken string, options ...Option) *Handler

New Apex Logs handler with the url, projectID, authToken and options.

func (*Handler) Close Uses

func (h *Handler) Close()

Close flushes any pending logs, and waits for flushing to complete. This method should be called before exiting your program to ensure entries have flushed properly.

func (*Handler) Flush Uses

func (h *Handler) Flush()

Flush any pending logs. This method is non-blocking.

func (*Handler) FlushSync Uses

func (h *Handler) FlushSync()

FlushSync any pending logs. This method is blocking.

func (*Handler) HandleLog Uses

func (h *Handler) HandleLog(e *log.Entry) error

HandleLog implements log.Handler.

type Option Uses

type Option func(*Handler)

Option function.

func WithBufferOptions Uses

func WithBufferOptions(options ...buffer.Option) Option

WithBufferOptions sets options for the underlying buffer used to batch logs.

func WithHTTPClient Uses

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the HTTP client used for requests.

Package apexlogs imports 7 packages (graph). Updated 2020-08-05. Refresh now. Tools for package owners.