Hi folks. Hope everyone is doing well
Caddy looks tremendously nice
Thanks to all the community !
i’m totally noob with the CaddyFile syntax and basics if someone can give me some hint i wold be grateful. thank you .
1. The problem I’m having:
I try to deploy a very simple caddy server with docker-compose. It works like charm but i need to produce logs (access.log) .
then need to transform my access.log to be readable by goaccess
If i understand correctly i need at least one external module :
caddy.logging.encoders.json
i really want to keep things simple and don’t want to compile via xcaddy.
My question is how can i achieve this very simple puprose or writing logs somewhere ?
i can’t find logs in data/acces.logs
2. Error messages and/or full log output:
{"level":"info","ts":1705715576.5076275,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'log': getting module named 'caddy.logging.writers.data/access.log': module not registered: caddy.logging.writers.data/access.log, at /etc/caddy/Caddyfile:10
3. Caddy version:
v2.7.6 h1
4. How I installed and ran Caddy:
via docker compose
a. System environment:
rocky 9 with podman.
b. Command:
podman-compose up -d
c. Service/unit/compose file:
version: "3.9"
services:
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./site:/var/www/html
- caddy_data:/data
- caddy_config:/config
depends_on:
- webdav
volumes:
caddy_data:
caddy_config:
d. My complete Caddy config:
my.super.domain {
# Set webroot
root * /var/www/html
# enable compression
encode zstd gzip
# Enable the static file server.
file_server
# enable log for goaccess
log default {
output data/access.log
format json
}
}