How to display Caddy Docker Logs in Console Format

1. Caddy version (caddy version):


2. How I run Caddy:

a. System environment:

Host - Ubuntu 20.04.2 LTS
Docker Desktop version - 20.10.6
Caddy container - caddy:latest

b. Command:

docker-compose up -d

c. Service/unit/compose file:

version: '3.8'
    image: xcaddy:latest
    container_name: caddy
      - 80:80
      - 443:443
      - wg-pia
      - TZ=America/Chicago
      - PUID=1000
      - PGID=1000
      - /var/run/docker.sock:/var/run/docker.sock
      - "${docker}/caddy2/data:/data"
      - "${docker}/caddy2/config:/config"
      - com.centurylinklabs.watchtower.enable=false

d. My complete Caddyfile or JSON config:

	https_port	443
	http_port	80
	log {
		format console

3. The problem I’m having:

The container logs are displayed in json rather than console format.

4. Error messages and/or full log output:

There are no error messages present in the container logs. They are just being displayed in json instead of console format.

5. What I already tried:

Searched the docs and the formum and I think I am using the correct syntax in the Caddyfile global block based on what I have read. Copied verbatim from the docs, but does not seem to be working for me. Guessing I am not understanding the docs correctly.

6. Links to relevant resources:

The console format still contains JSON, because logs are structured in Caddy.

This topic was automatically closed after 30 days. New replies are no longer allowed.