Skip to content
forked from brpaz/echozap

Middleware for Golang Echo framework that provides integration with Uber´s Zap logging library for logging HTTP requests

License

Notifications You must be signed in to change notification settings

ctarsjp/echozap

 
 

Repository files navigation

echozap

Middleware for Golang Echo framework that provides integration with Uber´s Zap logging library for logging HTTP requests.

License: MIT Commitizen friendly semantic-release

Actions Status Codacy Badge Codacy Badge

Pre-requisites

Usage

package main

import (
	"net/http"

	"github.com/brpaz/echozap"
	"github.com/labstack/echo/v4"
	"go.uber.org/zap"
)

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

	zapLogger, _ := zap.NewProduction()

	e.Use(echozap.ZapLogger(zapLogger))

	e.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, World!")
	})
	e.Logger.Fatal(e.Start(":1323"))
}

Logged details

The following information is logged:

  • Status Code
  • Time
  • Uri
  • Method
  • Hostname
  • Remote IP Address

Todo

  • Add more customization options.

🤝 Contributing

Contributions, issues and feature requests are welcome!

Show your support

If this project have been useful for you, I would be grateful to have your support.

Give a ⭐️ to the project, or just:

Buy Me A Coffee

Author

👤 Bruno Paz

📝 License

Copyright © 2019 Bruno Paz.

This project is MIT licensed.

About

Middleware for Golang Echo framework that provides integration with Uber´s Zap logging library for logging HTTP requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 71.8%
  • Makefile 28.2%