Odd behavior when moving to file based config

Hi, I had initially set up a quick poc in docker-compose using traefik 2.10. The little bit that i had configured was working. I'm not trying to break it out into dynamic file based config. There are two things that seem really off. Any help appreciated

  1. Log format. This was set to json in docker-compose, but i change dit to common. To confirm there is no reference to json in any of the configs or in compose, but the logging output seems to be mixed. Sometimes common, and then randomly it can switch back to json. Any thoughts?

  2. I'm having trouble with breaking the config into multiple pieces. I've tried several variations of how/where to define the middlewares, and i've tried calling them with and without "@file" suffix. No matter what,I keep getting errors that that middlewhere is not found.

# compose
version: '2'

networks:
  traefik:
    external: true

services:
  traefik:
    image: traefik:v2.11
    container_name: lb
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/home/me/.edgerc:/.edgerc:ro"
      - "./letsencrypt:/letsencrypt"
      - "./dynamic:/etc/traefik/dynamic:ro"
    command:
      - --api.insecure
      - --providers.file.directory=/etc/traefik/dynamic
      - --providers.docker
      - --providers.docker.network=traefik
    labels:
      - "traefik.http.routers.api.rule=Host(`localhost.my.com`)"
      - "traefik.http.routers.api.service=api@internal"
      - "traefik.http.routers.api.entrypoints=websecure"
      - "traefik.http.routers.api.tls.certresolver=letsencrypt-akamai"
    networks:
      - traefik
## 00-config-other.yaml
log:
  level: "INFO"
  format: "common"
## 10-config-environment.yaml
environment:
  - "AKAMAI_EDGERC=/.edgerc"
## 10-middleware-test-header.yaml
middlewares:
  headers:
    customRequestHeaders:
      Test-Header: "yeah"
## 10-middleware.yaml
middlewares:
  redirect-to-https:
    redirectScheme:
      scheme: "https"
      permanent: true
## 20-certificateresolver.yaml
certificatesresolvers:
  letsencrypt-akamai:
    acme:
      storage: "/letsencrypt/acme.json"
      email: "me@my.com"
      caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
      dnsChallenge:
## 50-entrypoints.yaml
entryPoints:
  web:
    address: "80"
  webssl:
    address: "443"
## 70-site_pw.insideamp.com.yaml
http:
  routers:
    pw-router:
      tls:
        certresolver: "letsencrypt-akamai"
      rule: "Host(`pw.my.com`)"
      service: "pw-service"
      entryPoints:
        - "web"
        - "websecure"
      middlewares:
        - "redirect-to-https"
        - "10-middleware-test-header"

  services:
    pw-service:
      loadBalancer:
        servers:
          - url: "http://test.my.net"

Traefik has static (entrypoints, api, log, certresolver, provider) and dynamic (routers, middlewares, services, static tls).

Static config can be in traefik.yml or command:, decide for one. Dynamic config needs to be loaded from file with providers.file or from labels with providers.docker.

Thank you that lead me down the right path i think. I'm moving everything out of docker-compose and into static config file or dynamic where appropriate.

One thing im getting stuck on though is the dnsChallenge. Im using edgedns for the provider, and I cannot figure out where/how i am supposed to configure the path to the edgerc.? This worked pretty much right out of the box in docker-compose.