Documentation ¶
Index ¶
- type AppInsightsHook
- func (hook *AppInsightsHook) AddFilter(name string, fn func(interface{}) interface{})
- func (hook *AppInsightsHook) AddIgnore(name string)
- func (hook *AppInsightsHook) Fire(entry *logrus.Entry) error
- func (hook *AppInsightsHook) Levels() []logrus.Level
- func (hook *AppInsightsHook) SetAsync(async bool)
- func (hook *AppInsightsHook) SetLevels(levels []logrus.Level)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppInsightsHook ¶
type AppInsightsHook struct {
// contains filtered or unexported fields
}
AppInsightsHook is a logrus hook for Application Insights
func New ¶
func New(name string, conf Config) (*AppInsightsHook, error)
New returns an initialised logrus hook for Application Insights
func NewWithAppInsightsConfig ¶
func NewWithAppInsightsConfig(name string, conf *appinsights.TelemetryConfiguration) (*AppInsightsHook, error)
NewWithAppInsightsConfig returns an initialised logrus hook for Application Insights
func (*AppInsightsHook) AddFilter ¶
func (hook *AppInsightsHook) AddFilter(name string, fn func(interface{}) interface{})
AddFilter adds a custom filter function.
func (*AppInsightsHook) AddIgnore ¶
func (hook *AppInsightsHook) AddIgnore(name string)
AddIgnore adds field name to ignore.
func (*AppInsightsHook) Fire ¶
func (hook *AppInsightsHook) Fire(entry *logrus.Entry) error
Fire is invoked by logrus and sends log data to Application Insights.
func (*AppInsightsHook) Levels ¶
func (hook *AppInsightsHook) Levels() []logrus.Level
Levels returns logging level to fire this hook.
func (*AppInsightsHook) SetAsync ¶
func (hook *AppInsightsHook) SetAsync(async bool)
SetAsync sets async flag for sending logs asynchronously. If use this true, Fire() does not return error.
func (*AppInsightsHook) SetLevels ¶
func (hook *AppInsightsHook) SetLevels(levels []logrus.Level)
SetLevels sets logging level to fire this hook.
Click to show internal directories.
Click to hide internal directories.