logrusmiddleware

package module
v0.0.0-...-1d7700f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2016 License: MIT Imports: 6 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

echo-logrusmiddleware

logrus middleware

An adapter (middleware) to make the Golang Echo web framework logging work with logrus, an excellent logging solution.

Install

$ go get github.com/sandalwing/echo-logrusmiddleware

Usage

package main

import (
	"github.com/Sirupsen/logrus"
	"github.com/labstack/echo"
	"github.com/sandalwing/echo-logrusmiddleware"
)

func main() {
	e := echo.New()

	// echo Logger interface friendly wrapper around logrus logger to use it
	// for default echo logger
	e.Logger = logrusmiddleware.Logger{logrus.StandardLogger()}
	e.Use(logrusmiddleware.Hook())

	// do the rest of your echo setup, routes, listen on server, etc..
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hook

func Hook() echo.MiddlewareFunc

Types

type Logger

type Logger struct {
	*logrus.Logger
}

func (Logger) Debugj

func (l Logger) Debugj(j log.JSON)

func (Logger) Errorj

func (l Logger) Errorj(j log.JSON)

func (Logger) Fatalj

func (l Logger) Fatalj(j log.JSON)

func (Logger) Infoj

func (l Logger) Infoj(j log.JSON)

func (Logger) Level

func (l Logger) Level() log.Lvl

func (Logger) Output

func (l Logger) Output() io.Writer

func (Logger) Panicj

func (l Logger) Panicj(j log.JSON)

func (Logger) Prefix

func (l Logger) Prefix() string

func (Logger) Printj

func (l Logger) Printj(j log.JSON)

func (Logger) SetLevel

func (l Logger) SetLevel(lvl log.Lvl)

func (Logger) SetOutput

func (l Logger) SetOutput(w io.Writer)

func (Logger) SetPrefix

func (l Logger) SetPrefix(s string)

func (Logger) Warnj

func (l Logger) Warnj(j log.JSON)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL