Breaking config changes on updates

I’ve just found out that v0.10.0 introduced at least one breaking change to the config, in that the log directive doesn’t seem to have a rotate element anymore, but uses a bunch of separate rotate xxx settings instead.

The only clue about this isn’t in the announcement email that goes out, but only when digging into the release notes is there a somewhat cryptic entry for

errors, log: Standardized, simplified directive syntax

Is there any chance that in future there might be a “upgrading” notes section in the docs? For an example, ElasticSearch has a “Breaking Changes” section in the docs, which is very useful for upgrading without having to dig through patch-notes or read every page of the manual and compare with what’s in the config.

Log Directive

simplified the redirect directive

log {
    redirect {
        age 30
        size 50
        keep 5
    }
 }

Has been changed to

log {
    redirect_age 30
    redirect_size 50
    redirect_keep 5
 }

Yeah, you’re right, I should have highlighted that better in the release notes. Will try to do that next time. (There was so much going on with that release that I wasn’t focused too much on the list of changes…)

Yeah, I appreciate the workload must be a bit mental :slight_smile:

Like the changes so far though, and the default rotation means I can take a whole load of stuff out of the config.

Now if only I could set the logging options once, outside of a site :wink:


Purely for posterity and giggles, here’s my current production config (domain names changed for habitual reasons)

:443, :80 {
  root /opt/caddy/html

  proxy / 10.117.1.24 {
    policy ip_hash
    transparent
    except /proxy_health
  }

  log / /var/log/caddy/access-default.log "[{when}] {hostname} {method} {host}  {path} {query} {status} {latency} {size} {>X-Forwarded-For} {>X-Forwarded-Proto} {>X-Dest-Ip}"
  errors /var/log/caddy/errors-default.log

  tls self_signed

  realip {
    from 1.1.1.1/32
  }
}


mydomain.bz:80, mydomain.bz:443 {
  proxy / 10.117.1.21 10.117.1.22 {
    policy ip_hash
    transparent
    except /proxy_health
  }

  log / /var/log/caddy/access-mydomain.log "[{when}] {hostname} {method} {host}  {path} {query} {status} {latency} {size} {>X-Forwarded-For} {>X-Forwarded-Proto} {>X-Dest-Ip}"
  errors /var/log/caddy/errors-mydomain.log

  tls letsencrypt@mydomain.co.uk
  tls {
    max_certs 10
  }

  realip {
    from 1.1.1.1/32
  }
}


testssl.myotherdomain.com {
  proxy / 10.117.1.24 {
    policy ip_hash
    transparent
  }

  tls letsencrypt@mydomain.co.uk
  tls {
    max_certs 10
  }

  log / /var/log/caddy/access-myotherdomain.log "[{when}] {remote} {hostname} {method} {host} {path} {query} {status} {latency} {size} {>X-Forwarded-For} {>X-Forwarded-Proto} {>X-Dest-Ip}"
  errors /var/log/caddy/errors-myotherdomain.log
}


test.something.co.uk {
  proxy / 10.117.1.21 10.117.1.22 {
    policy ip_hash
    transparent
  }

  tls /opt/caddy/ssl/static/something.co.uk.pem /opt/caddy/ssl/static/something.co.uk.co.uk.key

  realip {
    from 1.1.1.1/32
  }

  log / /var/log/caddy/access-something.log "[{when}] {hostname} {method} {host}  {path} {query} {status} {latency} {size} {>X-Forwarded-For} {>X-Forwarded-Proto} {>X-Dest-Ip}"
  errors /var/log/caddy/errors-something.log
}