Hi there, I am Faisal! ๐
Social Icons made by Freepik from www.flaticon.com
Module for KrakenD that enables getting GIN router logs in JSON format.
License: Apache License 2.0
Social Icons made by Freepik from www.flaticon.com
Add support for custom Log Formatter which allows developers to print logs in a custom format and also allows adding more fields or removing fields in the log.
The custom Formatter function should have access to gin.LogFormatterParams
, gin_logger.Config
and logging.Logger
instances.
I tried your logger and it doesn't work when im trying to bould krakend.
Im not a go coder, maybe im doing smth wrong.
Can u please checkout?
There's router_engine.go:
package krakend
import (
"io"
"github.com/ifaisalalam/krakend-gin-logger"
botdetector "github.com/devopsfaith/krakend-botdetector/gin"
httpsecure "github.com/devopsfaith/krakend-httpsecure/gin"
lua "github.com/devopsfaith/krakend-lua/router/gin"
"github.com/gin-gonic/gin"
"github.com/luraproject/lura/config"
"github.com/luraproject/lura/logging"
)
// NewEngine creates a new gin engine with some default values and a secure middleware
func NewEngine(cfg config.ServiceConfig, logger logging.Logger, w io.Writer) *gin.Engine {
if !cfg.Debug {
gin.SetMode(gin.ReleaseMode)
}
engine := gin.New()
engine.Use(gin_logger.NewLogger(
cfg.ExtraConfig,
logger,
gin.LoggerConfig{Output: w}), gin.Recovery())
engine.RedirectTrailingSlash = true
engine.RedirectFixedPath = true
engine.HandleMethodNotAllowed = true
if err := httpsecure.Register(cfg.ExtraConfig, engine); err != nil {
logger.Warning(err)
}
lua.Register(logger, cfg.ExtraConfig, engine)
botdetector.Register(cfg, logger, engine)
return engine
}
type engineFactory struct{}
func (e engineFactory) NewEngine(cfg config.ServiceConfig, l logging.Logger, w io.Writer) *gin.Engine {
return NewEngine(cfg, l, w)
}
There's an error:
sakro@kali:/git/krakend-ce$ make build
Building the binary...
# github.com/devopsfaith/krakend-ce
./router_engine.go:22:12: cannot use cfg.ExtraConfig (type "github.com/luraproject/lura/config".ExtraConfig) as type "github.com/devopsfaith/krakend/config".ExtraConfig in argument to gin_logger.NewLogger
make: *** [Makefile:85: build] Error 2
sakro@kali:/git/krakend-ce$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.