go-loggly: github.com/segmentio/go-loggly Index | Files | Directories

package loggly

import "github.com/segmentio/go-loggly"

Index

Package Files

loggly.go

Constants

const Version = "0.5.0"

type Client Uses

type Client struct {
    // Optionally output logs to the given writer.
    Writer io.Writer

    // Log level defaulting to INFO.
    Level Level

    // Size of buffer before flushing [100]
    BufferSize int

    // Flush interval regardless of size [5s]
    FlushInterval time.Duration

    // Loggly end-point.
    Endpoint string

    // Token string.
    Token string

    // Default properties.
    Defaults Message

    sync.Mutex
    // contains filtered or unexported fields
}

Loggly client.

func New Uses

func New(token string, tags ...string) *Client

New returns a new loggly client with the given `token`. Optionally pass `tags` or set them later with `.Tag()`.

func (*Client) Alert Uses

func (c *Client) Alert(t string, props ...Message) error

Alert log.

func (*Client) Critical Uses

func (c *Client) Critical(t string, props ...Message) error

Critical log.

func (*Client) Debug Uses

func (c *Client) Debug(t string, props ...Message) error

Debug log.

func (*Client) Emergency Uses

func (c *Client) Emergency(t string, props ...Message) error

Emergency log.

func (*Client) Error Uses

func (c *Client) Error(t string, props ...Message) error

Error log.

func (*Client) Flush Uses

func (c *Client) Flush() error

Flush the buffered messages.

func (*Client) Info Uses

func (c *Client) Info(t string, props ...Message) error

Info log.

func (*Client) Notice Uses

func (c *Client) Notice(t string, props ...Message) error

Notice log.

func (*Client) Send Uses

func (c *Client) Send(msg Message) error

Send buffers `msg` for async sending.

func (*Client) Tag Uses

func (c *Client) Tag(tags ...string)

Tag adds the given `tags` for all logs.

func (*Client) Warn Uses

func (c *Client) Warn(t string, props ...Message) error

Warning log.

func (*Client) Write Uses

func (c *Client) Write(b []byte) (int, error)

Write raw data to loggly.

type Level Uses

type Level int
const (
    DEBUG Level = iota
    INFO
    NOTICE
    WARNING
    ERROR
    CRITICAL
    ALERT
    EMERGENCY
)

type Message Uses

type Message map[string]interface{}

Directories

PathSynopsis
examples

Package loggly imports 9 packages (graph) and is imported by 23 packages. Updated 2018-07-31. Refresh now. Tools for package owners.