logtail

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 5 Imported by: 0

README

logtail

Go Report Card

logtail client for go

Collect logs directly from your go applications.Port from official .net client

Logtail is a hosted service that centralizes all of your logs into one place. Allowing for analysis, correlation and filtering with SQL. Actionable Grafana dashboards and collaboration come built-in. Logtail works with any language or platform and any data source.

Features

  • Simple integration.
  • Support for structured logging and events.
  • Automatically captures useful context.
  • Performant, light weight, with a thoughtful design.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidSourceToken = errors.New("you provided an invalid source token")
	InvalidBodyFormat  = errors.New("invalid body format:The body is not a valid JSON or MessagePack")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(authToken string, options ...Option) *Client

func (Client) Send

func (c Client) Send(payload any) (n int, err error)

func (Client) Write

func (c Client) Write(body []byte) (n int, err error)

type ContentType

type ContentType string
const (
	MsgPack ContentType = "application/msgpack"
	Json    ContentType = "application/json; charset=UTF-8"
)

type Marshaler

type Marshaler func(data any) ([]byte, error)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithAuthToken

func WithAuthToken(autoToken string) Option

WithAuthToken sets the custom auth token.

func WithCustomServer

func WithCustomServer(server string) Option

WithCustomServer sets the custom server to connect .

func WithDefaultContentType

func WithDefaultContentType(contentType ContentType) Option

WithDefaultContentType sets the default content type to json.

func WithDefaultMarshaler

func WithDefaultMarshaler(marshaler Marshaler) Option

WithDefaultMarshaler sets the default marshaler.

func WithHttpTransport

func WithHttpTransport(transport *http.Transport) Option

WithHttpTransport sets the custom http transport.

Jump to

Keyboard shortcuts

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