develop #1
@ -11,7 +11,7 @@ ARG SVC_NAME
|
|||||||
ARG SVC_VER
|
ARG SVC_VER
|
||||||
|
|
||||||
LABEL dev.egommerce.image.author="Piotr Biernat"
|
LABEL dev.egommerce.image.author="Piotr Biernat"
|
||||||
LABEL dev.egommerce.image.service="api-eventubus"
|
LABEL dev.egommerce.image.vendor="Egommerce"
|
||||||
LABEL dev.egommerce.image.service=${SVC_NAME}
|
LABEL dev.egommerce.image.service=${SVC_NAME}
|
||||||
LABEL dev.egommerce.image.version=${SVC_VER}
|
LABEL dev.egommerce.image.version=${SVC_VER}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"git.pbiernat.dev/egommerce/go-api-pkg/fluentd"
|
"git.pbiernat.dev/egommerce/go-api-pkg/fluentd"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
)
|
)
|
||||||
@ -21,6 +23,11 @@ func SetupMiddlewares(s *Server) {
|
|||||||
// Middlewares
|
// Middlewares
|
||||||
func LoggingMiddleware(log *fluentd.Logger) func(c *fiber.Ctx) error {
|
func LoggingMiddleware(log *fluentd.Logger) func(c *fiber.Ctx) error {
|
||||||
return func(c *fiber.Ctx) error {
|
return func(c *fiber.Ctx) error {
|
||||||
|
path := string(c.Request().URI().Path())
|
||||||
|
if strings.Contains(path, "/health") {
|
||||||
|
return c.Next()
|
||||||
|
}
|
||||||
|
|
||||||
log.Log("Request: %s, remote: %s, via: %s",
|
log.Log("Request: %s, remote: %s, via: %s",
|
||||||
c.Request().URI().String(),
|
c.Request().URI().String(),
|
||||||
c.Context().RemoteIP().String(),
|
c.Context().RemoteIP().String(),
|
||||||
|
Loading…
Reference in New Issue
Block a user