geoblock icon indicating copy to clipboard operation
geoblock copied to clipboard

Having 2 middlewares with same plugin logs all in same file

Open lluisd opened this issue 9 months ago • 1 comments

I am defining 2 middlewares with 2 distinct log file paths but all logs are saved in the first one. But it creates the empty file of the second middleware.

  middlewares:
    geoblock-es:
      plugin:
        geoblock:
          ipGeolocationHttpHeaderField: "cf-ipcountry"
          xForwardedForReverseProxy: true
          silentStartUp: true
          allowLocalRequests: true
          logLocalRequests: false
          logAllowedRequests: true
          logApiRequests: true
          api: "https://get.geojs.io/v1/ip/country/{ip}"
          apiTimeoutMs: 5000                                 # optional
          ignoreAPITimeout: true
          cacheSize: 100
          forceMonthlyUpdate: true
          allowUnknownCountries: false
          unknownCountryApiResponse: "nil"
          addCountryHeader: true
          logFilePath: "/etc/traefik_logs/geoblock-es.log"
          countries:
            - ES

    geoblock-es-ie:
      plugin:
        geoblock:
          ipGeolocationHttpHeaderField: "cf-ipcountry"
          xForwardedForReverseProxy: true
          silentStartUp: true
          allowLocalRequests: true
          logLocalRequests: true
          logAllowedRequests: true
          logApiRequests: true
          api: "https://get.geojs.io/v1/ip/country/{ip}"
          apiTimeoutMs: 5000                                 # optional
          ignoreAPITimeout: true
          cacheSize: 100
          forceMonthlyUpdate: true
          allowUnknownCountries: false
          unknownCountryApiResponse: "nil"
          addCountryHeader: true
          logFilePath: "/etc/traefik_logs/geoblock-ie.log"
          countries:
            - ES
            - IE

all my logs go to geoblock-es.log

Image

and the content mixes both middlewares

Image

lluisd avatar Mar 31 '25 14:03 lluisd