tsarpaul / logrus_sqs

A Logrus hook for Amazon Simple Queue Service (SQS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQS Hook for Logrus :walrus:

Installation

$ go get github.com/tsarpaul/logrus_sqs

Usage

package main

import (
	"github.com/Sirupsen/logrus"
	"github.com/tsarpaul/logrus_sqs"
)

func main() {
	sqsHook, err := logrus_sqs.NewSQSHook("random_queue_name", "eu-central-1")
	if err != nil {
		panic(err)
	}
	log.AddHook(sqsHook)

	log.WithFields(log.Fields{
		"hello": "world",
	}).Info("Hello world!")
}

You may provide a custom AWS Session with logrus_sqs.NewSQSHookWithSession

About

A Logrus hook for Amazon Simple Queue Service (SQS)

License:MIT License


Languages

Language:Go 100.0%