Skip to content

LogLess is a centralized logging/event stack using AWS Kinesis/Lambda. This is a Golang logging lib.

License

Notifications You must be signed in to change notification settings

apolloFER/logless-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogLess

LogLess is a centralized logging/event stack using AWS Kinesis/Lambda. The Golang version works as a Logrus hook.

Usage

Create a new LoglessHook with the name of your Kinesis stream as the first parameter. The second parameter is the logrus log to use for internal logging. If you don't supply one (nil), LogLess will create a new one.

You should defer the logless.OnClose() method in your main() function since it's used for flushing outstanding entries to Kinesis.

Example

package main

import (
	log "github.com/Sirupsen/logrus"
	"github.com/apolloFER/logless-golang"
)

func main() {
	hook, _ := logless.NewLoglessHook("logless-test", log.New())
	defer logless.OnClose()

	log.AddHook(hook)

	log.WithFields(log.Fields{
		"omg":    true,
		"number": 122,
	}).Warn("The group's number increased tremendously 1!")

	log.WithFields(log.Fields{
		"omg":    true,
		"number": 123,
	}).Info("The group's number increased tremendously 2!")

	log.WithFields(log.Fields{
		"omg":    true,
		"number": 124,
	}).Error("The group's number increased tremendously 3!")
}

License

Apache License 2.0

About

LogLess is a centralized logging/event stack using AWS Kinesis/Lambda. This is a Golang logging lib.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages