Add ip and query params in fiber logger (#1268)
Co-authored-by: walker-16 <agpazos85@gmail.com>
This commit is contained in:
parent
f635f1d785
commit
451c48a670
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/wormhole-foundation/wormhole-explorer/api/handlers/protocols"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
@ -12,6 +11,8 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/wormhole-foundation/wormhole-explorer/api/handlers/protocols"
|
||||
|
||||
frs "github.com/XLabs/fiber-redis-storage"
|
||||
"github.com/ansrivas/fiberprometheus/v2"
|
||||
"github.com/go-redis/redis/v8"
|
||||
|
@ -196,7 +197,7 @@ func main() {
|
|||
|
||||
app.Use(requestid.New())
|
||||
app.Use(logger.New(logger.Config{
|
||||
Format: "level=info timestamp=${time} method=${method} path=${path} latency=${latency} status${status} request_id=${locals:requestid}\n",
|
||||
Format: "level=info timestamp=${time} method=${method} path=${path} latency=${latency} status${status} request_id=${locals:requestid} ip=${ips} queryParams=${queryParams}\n",
|
||||
Next: func(c *fiber.Ctx) bool {
|
||||
path := c.Path()
|
||||
if path == "/api/v1/health" || path == "/api/v1/ready" {
|
||||
|
|
|
@ -72,6 +72,8 @@ spec:
|
|||
value: "{{ .WORMSCAN_RATELIMIT_ENABLED }}"
|
||||
- name: WORMSCAN_RATELIMIT_MAX
|
||||
value: "{{ .WORMSCAN_RATELIMIT_MAX }}"
|
||||
- name: WORMSCAN_RATELIMIT_TOKENS
|
||||
value: "{{ .WORMSCAN_RATELIMIT_TOKENS }}"
|
||||
- name: WORMSCAN_RATELIMIT_PREFIX
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
|
|
Loading…
Reference in New Issue