Skip to content

jcftang/logentriesrus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

r7insight Hook for Logrus

Package logentriesrus provides a r7insight hook for the logrus logging package.

Example usage

package main

import (
    "os"

    "github.com/sirupsen/logrus"
    "github.com/jcftang/logentriesrus"
)

func main() {

    logrus.SetFormatter(&logrus.JSONFormatter{})

    logrus.SetOutput(os.Stderr)

    logrus.SetLevel(logrus.DebugLevel)

    le, err := logentriesrus.NewLogentriesrusHook("eu.data.logs.insight.rapid7.com", "5605593B-9E4F-4A3E-9865-12752055E14B")
    if err != nil {
        os.Exit(-1)        
    }
    logrus.AddHook(le)

    logrus.WithFields(logrus.Fields{"foo": "bar", "foo2": 42}).Warn("this is a warn level message")
    logrus.Info("this is an info level message")
    logrus.Debug("this is a debug level message")
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages