hooks

package
v0.0.0-...-21d4feb Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SentryHook

type SentryHook struct {
	// Timeout sets the time to wait for a delivery error from the sentry server.
	// If this is set to zero the server will not wait for any response and will
	// consider the message correctly sent
	Timeout                 time.Duration
	StacktraceConfiguration stacktraceConfiguration
	// contains filtered or unexported fields
}

SentryHook delivers logs to a sentry server.

func NewSentryHook

func NewSentryHook(DSN string, levels []logrus.Level) (*SentryHook, error)

NewSentryHook creates a hook to be added to an instance of logger and initializes the raven client. This method sets the timeout to 100 milliseconds.

func NewWithClientSentryHook

func NewWithClientSentryHook(client *raven.Client, levels []logrus.Level) (*SentryHook, error)

NewWithClientSentryHook creates a hook using an initialized raven client. This method sets the timeout to 100 milliseconds.

func NewWithTagsSentryHook

func NewWithTagsSentryHook(DSN string, tags map[string]string, levels []logrus.Level) (*SentryHook, error)

NewWithTagsSentryHook creates a hook with tags to be added to an instance of logger and initializes the raven client. This method sets the timeout to 100 milliseconds.

func (*SentryHook) Fire

func (hook *SentryHook) Fire(entry *logrus.Entry) error

Called when an event should be sent to sentry Special fields that sentry uses to give more information to the server are extracted from entry.Data (if they are found) These fields are: logger, server_name and http_request

func (*SentryHook) Levels

func (hook *SentryHook) Levels() []logrus.Level

Levels returns the available logging levels.

Jump to

Keyboard shortcuts

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