Popularity
5.6
Growing
Activity
4.1
Declining
8
87
0

Programming language: Go
Tags: Logging    
Latest version: v1.1.0

logrusiowriter alternatives and similar packages

Based on the "Logging" category

Do you think we are missing an alternative of logrusiowriter or a related project?

Add another 'Logging' Package

README

logrusiowriter

io.Writer implementation using logrus

Travis CI build status GoDoc Coverage Status Mentioned in Awesome Go

Motivation

Many golang libraries use the golang's log package to print their logs. This means that if your application uses logrus to print structured logging, those packages will print a format that is (probably) incompatible with yours, and you may end losing logs in your logs collector because they can't be parsed properly.

Solution

Print the logs written using log.Printf through logrus, by setting log.SetOutput to an io.Writer implementation that uses logrus as output, i.e.:

    log.SetOutput(logrusiowriter.New())

See example_*_test.go files to find testable examples that serve as documentation.