Loggly Hooks for GO Logrus logger

Loggly Hooks for Logrus :walrus:

Usage

package main

import (
	"github.com/sirupsen/logrus"
	"github.com/sebest/logrusly"
)

var logglyToken string = "YOUR_LOGGLY_TOKEN"

func main() {
	log := logrus.New()
	hook := logrusly.NewLogglyHook(logglyToken, "www.hostname.com", logrus.WarnLevel, "tag1", "tag2")
	log.Hooks.Add(hook)

	log.WithFields(logrus.Fields{
		"name": "joe",
		"age":  42,
	}).Error("Hello world!")

	// Flush is automatic for panic/fatal
	// Just make sure to Flush() before exiting or you may loose up to 5 seconds
	// worth of messages.
	hook.Flush()
}
Comments
  • Missing LICENSE

    Missing LICENSE

    If possible could you decide on a license type and add a LICENSE file? I'd love to use this in a project but I require an explicit published license to do so. Thanks!

  • New Trace log level in logrus

    New Trace log level in logrus

    Hello, I'm just opening this issue to let you know, the next release of logrus (v1.2.0) will add a new trace level named Trace below Debug. Here is the PR for reference sirupsen/logrus#844 You may want to take into account this new level.

  • Package no longer builds due to segmentio/go-loggly not building

    Package no longer builds due to segmentio/go-loggly not building

  • case-insensitive import collision for logrus

    case-insensitive import collision for logrus

    It looks like Sirupsen/logrus has updated the import path to have a lowercase "s", I am now seeing this error

    case-insensitive import collision: "github.com/Sirupsen/logrus" and "github.com/sirupsen/logrus"

  • Always cast errors to strings

    Always cast errors to strings

    Without this change, errors tend to print as {}, or whatever the exported fields on the concrete implementation of the error are.

    This code borrowed from logrus.JSONFormatter: https://github.com/Sirupsen/logrus/commit/8287db793

    (It would be nice if logrusly could just use JSONFormatter and call client.Write instead of client.Send, but they make slightly different choices for names for the timestamp and message fields, as well as the capitalization of the level.)

  • Exposing go-loggly .Tag() functionality

    Exposing go-loggly .Tag() functionality

    I need to expose go-loggly's .Tag() functionality because I have a []string of tags and I need to loop through them instead of adding the tags in the NewLogglyHook()

  • Set if push or ignore host field

    Set if push or ignore host field

    Every message will have host field, It's duplicated and it takes more storage. Add IgnoreHostField(bool) to set if ignore pushing host field, it's false by default.

  • Flush() ignores errors

    Flush() ignores errors

    The go-loggly client returns a possible error from Flush, but logrusly ignores it.

    It should return the same error. To not break backward compatibility, perhaps a FlushError() method could be added, which exposes the error?

Hooks-goreleaser - GoReleaser hooks plugin

?? hooks-goreleaser The GoReleaser integration for go-semantic-release. Usage Us

Jan 30, 2022
Binalyze logger is an easily customizable wrapper for logrus with log rotation

logger logger is an easily customizable wrapper for logrus with log rotation Usage There is only one function to initialize logger. logger.Init() When

Oct 2, 2022
A customized GORM logger that implements the appropriate interface and uses Logrus to output logs

CryptoMath GORM Logger A customized GORM logger that implements the appropriate interface and uses Logrus to output logs. Install go get github.com/ma

Nov 6, 2021
A logrus.Hook that logs with a zap.Logger

zaprus Ever had a 3rd-party dependency requiring a logrus, but you're using zap? zaprus provides a logrus.Hook that makes a logrus.(Entry|Logger) repl

Feb 27, 2022
Convenient Logger interface and std logger wrapper

Convenient logger interface and wrapper around std logger Interface type Logger interface { Error(err error) Debugf(format string, args ...interface

Nov 28, 2021
Logger - Simple logger without written with std pkg

Go-Logger Simple usage is: package main

Jan 2, 2022
Logger - A thin wrapper of uber-go/zap logger for personal project

a thin wraper of uber-go/zap logger for personal project 0. thanks uber-go/zap B

Sep 17, 2022
Logrus is a structured, pluggable logging for Go.
Logrus is a structured, pluggable logging for Go.

Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger.

May 25, 2021
Simple example of creating an `LD_PRELOAD` library in Go that hooks LibC's main function.

LD_PRELOAD in Go Simple example of creating an LD_PRELOAD library in Go that hooks LibC's main function. Code hooks __libc_start_main to run before th

Nov 9, 2022
A logger, for Go

Go-Log A logger, for Go! It's sort of log and code.google.com/p/log4go compatible, so in most cases can be used without any code changes. Breaking cha

Oct 7, 2022
Simple logger for Go programs. Allows custom formats for messages.
Simple logger for Go programs. Allows custom formats for messages.

go-logger A simple go logger for easy logging in your programs. Allows setting custom format for messages. Preview Install go get github.com/apsdehal/

Dec 17, 2022
A 12-factor app logger built for performance and happy development
A 12-factor app logger built for performance and happy development

logxi log XI is a structured 12-factor app logger built for speed and happy development. Simpler. Sane no-configuration defaults out of the box. Faste

Nov 27, 2022
Dead simple, super fast, zero allocation and modular logger for Golang

Onelog Onelog is a dead simple but very efficient JSON logger. It is one of the fastest JSON logger out there. Also, it is one of the logger with the

Sep 26, 2022
A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.
A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

SQLDB-Logger A logger for Go SQL database driver without modify existing *sql.DB stdlib usage. Colored console writer output above only for sample/dev

Jan 3, 2023
xlog is a logger for net/context aware HTTP applications
xlog is a logger for net/context aware HTTP applications

⚠️ Check zerolog, the successor of xlog. HTTP Handler Logger xlog is a logger for net/context aware HTTP applications. Unlike most loggers, xlog will

Sep 26, 2022
Zero Allocation JSON Logger
Zero Allocation JSON Logger

Zero Allocation JSON Logger The zerolog package provides a fast and simple logger dedicated to JSON output. Zerolog's API is designed to provide both

Jan 1, 2023
A powerful zero-dependency json logger.

ZKits Logger Library About This package is a library of ZKits project. This is a zero-dependency standard JSON log library that supports structured JS

Dec 14, 2022
Configurable Logger for Go

Timber! This is a logger implementation that supports multiple log levels, multiple output destinations with configurable formats and levels for each.

Jun 28, 2022
A feature-rich and easy to use logger for golang
A feature-rich and easy to use logger for golang

A feature-rich and easy to use logger for golang ?? Install ?? Common Logs lumber.Success() lumber.Info() lumber.Debug() lumber.Warning()

Dec 31, 2022