Documentation ¶
Index ¶
- Variables
- type SentryHook
- func NewAsyncSentryHook(DSN string, levels []logrus.Level) (*SentryHook, error)
- func NewAsyncWithClientSentryHook(client *raven.Client, levels []logrus.Level) (*SentryHook, error)
- func NewAsyncWithTagsSentryHook(DSN string, tags map[string]string, levels []logrus.Level) (*SentryHook, error)
- func NewSentryHook(DSN string, levels []logrus.Level) (*SentryHook, error)
- func NewWithClientSentryHook(client *raven.Client, levels []logrus.Level) (*SentryHook, error)
- func NewWithTagsSentryHook(DSN string, tags map[string]string, levels []logrus.Level) (*SentryHook, error)
- func (hook *SentryHook) AddExtraFilter(name string, fn func(interface{}) interface{})
- func (hook *SentryHook) AddIgnore(name string)
- func (hook *SentryHook) Fire(entry *logrus.Entry) error
- func (hook *SentryHook) Flush()
- func (hook *SentryHook) Levels() []logrus.Level
- func (hook *SentryHook) SetEnvironment(environment string)
- func (hook *SentryHook) SetRelease(release string)
- type StackTraceConfiguration
- type Stacktracer
Constants ¶
This section is empty.
Variables ¶
var BufSize uint = 8192
BufSize controls the number of logs that can be in progress before logging will start blocking. Set logrus_sentry.BufSize = <value> _before_ calling NewAsync*().
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 NewAsyncSentryHook ¶ added in v0.2.8
func NewAsyncSentryHook(DSN string, levels []logrus.Level) (*SentryHook, error)
NewAsyncSentryHook creates a hook same as NewSentryHook, but in asynchronous mode. This method sets the timeout to 1000 milliseconds.
func NewAsyncWithClientSentryHook ¶ added in v0.2.8
func NewAsyncWithClientSentryHook(client *raven.Client, levels []logrus.Level) (*SentryHook, error)
NewAsyncWithClientSentryHook creates a hook same as NewWithClientSentryHook, but in asynchronous mode. This method sets the timeout to 1000 milliseconds.
func NewAsyncWithTagsSentryHook ¶ added in v0.2.8
func NewAsyncWithTagsSentryHook(DSN string, tags map[string]string, levels []logrus.Level) (*SentryHook, error)
NewAsyncWithTagsSentryHook creates a hook same as NewWithTagsSentryHook, but in asynchronous mode. This method sets the timeout to 1000 milliseconds.
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) AddExtraFilter ¶ added in v0.2.1
func (hook *SentryHook) AddExtraFilter(name string, fn func(interface{}) interface{})
AddExtraFilter adds a custom filter function.
func (*SentryHook) AddIgnore ¶ added in v0.2.1
func (hook *SentryHook) AddIgnore(name string)
AddIgnore adds field name to ignore.
func (*SentryHook) Fire ¶
func (hook *SentryHook) Fire(entry *logrus.Entry) error
Fire is 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: error, logger, server_name, http_request, tags
func (*SentryHook) Flush ¶ added in v0.2.8
func (hook *SentryHook) Flush()
Flush waits for the log queue to empty. This function only does anything in asynchronous mode.
func (*SentryHook) Levels ¶
func (hook *SentryHook) Levels() []logrus.Level
Levels returns the available logging levels.
func (*SentryHook) SetEnvironment ¶ added in v0.2.6
func (hook *SentryHook) SetEnvironment(environment string)
SetEnvironment sets environment tag.
func (*SentryHook) SetRelease ¶ added in v0.2.6
func (hook *SentryHook) SetRelease(release string)
SetRelease sets release tag.
type StackTraceConfiguration ¶
type StackTraceConfiguration struct { // whether stacktraces should be enabled Enable bool // the level at which to start capturing stacktraces Level logrus.Level // how many stack frames to skip before stacktrace starts recording Skip int // the number of lines to include around a stack frame for context Context int // the prefixes that will be matched against the stack frame. // if the stack frame's package matches one of these prefixes // sentry will identify the stack frame as "in_app" InAppPrefixes []string }
StackTraceConfiguration allows for configuring stacktraces
type Stacktracer ¶ added in v0.2.2
type Stacktracer interface {
GetStacktrace() *raven.Stacktrace
}
The Stacktracer interface allows an error type to return a raven.Stacktrace.