Skip to content

[Bug]: Caddy logging difficulties #5640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LaurenceJJones opened this issue Apr 17, 2025 · 1 comment
Open

[Bug]: Caddy logging difficulties #5640

LaurenceJJones opened this issue Apr 17, 2025 · 1 comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.

Comments

@LaurenceJJones
Copy link
Contributor

Error Message and Logs

By default Caddy does not log any access logs and if you want to enable them globally then you can add the following:

{
	log {
		output stdout
		format console
	}
}

However, the way coolify handles the dynamic files means it not possible to define this as import /dynamic/*.caddy is always written to the Caddyfile and if you attempt to creates a log.caddy as a dynamic file Caddy will reject this configuration as it expects all global configuration to be at the top of the file.

Steps to Reproduce

  1. Configure coolify to use Caddy proxy
  2. Manually edit /data/coolify/proxy/caddy/dynamic/Caddyfile to include the snippet above the import statements
  3. Restart the proxy and manual configuration is now reverted

options 2:

  1. Configure coolify to use Caddy proxy
  2. Create a log.caddy file in the interface with the snippet
  3. Gets error that the configuration is invalid but closing the prompt still saves the file.

Example Repository URL

No response

Coolify Version

latest

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

No response

Additional Information

No response

@LaurenceJJones LaurenceJJones added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Apr 17, 2025
@LaurenceJJones
Copy link
Contributor Author

LaurenceJJones commented Apr 17, 2025

A workaround for now is on each deployment where you want access logs you can add the following so the Caddy docker labels are generating the correct one per host:

services:
  wordpress:
    image: 'wordpress:latest'
    volumes:
      - 'wordpress-files:/var/www/html'
    environment:
      - SERVICE_FQDN_WORDPRESS
    labels:
      - 'caddy_0.log.output=stdout' ## This label was manually added by me
    healthcheck:
      test:
        - CMD
        - curl
        - '-f'
        - 'http://127.0.0.1'
      interval: 2s
      timeout: 10s
      retries: 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.
Projects
None yet
Development

No branches or pull requests

1 participant