I cannot see access log file for specific site

1. Output of caddy version: v2.5.1

2. How I run Caddy:

using Docker-compose

a. System environment:

Docker

b. Command:

it is running with Docker-compose

c. Service/unit/compose file:

Docker

d. My complete Caddy config:

example.fr {
handle {
reverse_proxy example-container-hostname:80
}
log {
output file /var/log/example.fr-access.log
}
import common
}

3. The problem I’m having:

from 29.August.2022 , log file for that specific site is not generated anymore;

4. Error messages and/or full log output:

nothing to pass it

5. What I already tried:

I have tried to change location and restart the container , nothing happened

6. Links to relevant resources:

Please upgrade to v2.5.2

What do you mean? What does your docker-compose.yml look like? Did you set up a volume for /var/log?

There’s really not enough detail in your post for us to glean anything from this.

for other site ; the logs are there ; but for one specific site , since 29 august no new log files generated
I did not set a volume for logs in docker-compose

my docker-compose looks like this


version: "3.7"

networks:
        web:
                external: true
        internal:
                external: true
                driver: bridge

services:
        caddy:
                image: caddy:2-alpine
                restart: always
                ports:
                        - "80:80"
                        - "443:443"
                volumes:
                        - ./Caddyfile:/etc/caddy/Caddyfile
                networks:
                        - web
                        - internal

When you say “no log files generated”, where are you looking? If you don’t have a volume for it, then the files aren’t on your host machine, they’re inside the container.

Also, you really must set up a volume for /data, otherwise you’re throwing away Caddy’s storage every time, meaning you lose your certs and keys. Please see the docs on Docker Hub which explain.

yeah , i’m talking about the logs inside the container , for that specific site it is gone since that date ; and still see the logs for other sites , we always talk inside the container

even that I had redeployed Caddy with new version 2.5.2 ; and specified the /data as volume, the log files for that specirfic site is not generated
it is strange , why for that only site ?

nothing special to mention @francislavoie ?

why there is no response ? if there is no solution just simply say there is no solution but not ignore please

Mehdi, please be patient. Francis is on vacation, and is not obligated to respond to you at all, let alone in a timely fashion. If you need that level of support you can pay for it.

2 Likes

so all Caddy’s community is relaying on one person ?
who said about “Obligation” here ? if you can see also , it 7d topic age , with one comment from experts
but anyway , I’m not gonna spend more effort explaing

Mehdi, it’s a weekend. We have lives. I’m at church with my family for example. Our community relies on people who give of their time and not people who demand help and become beligerent.

We’ll help you when we have a chance. Sometimes with open source you just have to figure things out yourself unless you pay for help.

1 Like

I can respect this also , and I never demand a quick reply or an instant reply , if you can see I’m not abusing and replied after 6days !

It’s not 1 person, and can see that by the activity on the forum, but we’re all busy and try to make do with our lives and other obligations plus the apparent complexity of the case. This statement

if there is no solution just simply say there is no solution but not ignore please

comes across negatively to the helpers. Have you done any investigative work meanwhile? Have you tried anything to investigate what changed? Open source help is cooperative process.

Share you full Caddyfile to see. Do not redact anything except for sensitive details such as API keys. Domain names are not sensitive. Also share how you’re setting up the containers, Docker environment, and how you’re checking the log files inside the containers.

2 Likes

Caddy file


{
    # Global options block. Entirely optional, https is on by default
    # Optional email key for lets encrypt
    email info@innoyadev.fr
    # Optional staging lets encrypt for testing. Comment out for production.
    # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
(common) {
    header /* {
        -Server
        -x-powered-by
        -x-debug-token
        -x-debug-token-link
        -x-robots-tag
    }
}


tls.mk-go.fr {
        handle_path /goaccess {
                reverse_proxy b5e4f8aa5883:80
        }
        handle {
                reverse_proxy p-TLS-2223:80
        }
  log {
    output file /var/log/caddy/tls.mk-go.fr-access.log
  }
import common
}

Caddy’s - docker-compose file


version: "3.7"
services:
    caddy:
       image: caddy:2.5.2-alpine
       restart: always
       container_name: Proxy_caddy
       hostname: p-caddy
       ports:
         - "80:80"
         - "443:443"
       volumes:
         - ./Caddyfile:/etc/caddy/Caddyfile
         - ./data:/data
         - /var/InnoyaServices/logs/caddy:/var/log/caddy
       networks:
         - web
         - internal
         - my-network
networks:
   web:
     external: true
   internal:
     external: true
     driver: bridge
   my-network:
     external: true

checking logs either inside or outside container by simply : ls -lart

You say

for that specific site is not generated anymore;

Do you have other sites? If yes, are they configured on the same Caddy instance? If yes, where’s their config? How different is the provided config from the one you deploy?

1 Like

yes configured on the same Caddy instance
all the setup is the same for all sites
example of second site :


bod.mk-go.fr {
        handle {
                reverse_proxy bod:80
        }
  log {
    output file /var/log/caddy/bod.mk-go.fr-access.log
  }
import common
}

I have also tried to redeploy it from docker-compose , nothing special happen

Then please share the exact config you have in production, including the actual domain names.

1 Like

updated on the above comments
all required infos are delivered in all comments

I’m sorry but it’s still not enough. Bear with me. You say you have multiple sites served by the same Caddy instance, but the config you shared shows only one site. If you have multiple sites, please share full config. We need to see whether sites are overwriting each other’s log config in case that’s true and is a bug. Please share the full Caddyfile unredacted (except for API keys) so we can see how the multiple sites interacting. I need to investigate the translation from Caddyfile to JSON (caddy’s internal representation of the config).

3 Likes
{
    # Global options block. Entirely optional, https is on by default
    # Optional email key for lets encrypt
    email info@innoyadev.fr
    # Optional staging lets encrypt for testing. Comment out for production.
    # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
(common) {
    header /* {
        -Server
        -x-powered-by
        -x-debug-token
        -x-debug-token-link
        -x-robots-tag
    }
}
tls.mk-go.fr/metrics {
        metrics
}
tls.mk-go.fr {
        handle {
                reverse_proxy p-TLS-2223:80
        }
  log {
    output file /var/log/caddy/tls.mk-go.fr-access.log
  }
import common
}
bod.mk-go.fr {
         handle_path /goaccess {
                reverse_proxy p-GoAccess-Apache:7890
        }

        handle {
                reverse_proxy p-BOD-2223:80
        }
  log {
    output file /var/log/caddy/bod.mk-go.fr-access.log
    format json
  }
import common
}
bod.mk-go.fr:52122 {
        handle {
                reverse_proxy p-BOD-2122:80
        }
  log {
    output file /var/log/caddy/bod2122.mk-go.fr-access.log
  }
import common
}
gers.mk-go.fr {
        handle {
                reverse_proxy p-GERS-2223:80
        }
  log {
    output file /var/log/caddy/gers.mk-go.fr-access.log
  }
import common
}
  
www.tls.mk-go.fr {
    redir https://tls.mk-go.fr{uri}
}