Caddy: {combined} placeholder do not work

Created on 10 Feb 2017  路  2Comments  路  Source: caddyserver/caddy

1. What version of Caddy are you running (caddy -version)?

Caddy 0.9.5

2. What are you trying to do?

logging combined format access.log

3. What is your entire Caddyfile?

minio.example.com {

        proxy / localhost:9000 {
            header_upstream X-Forwarded-Proto {scheme}
            header_upstream X-Forwarded-Host {host}
            header_upstream Host {host}
        }

        log /var/log/caddy/minio/access.log "{combined}" {
                rotate {
                        size 128
                        age 14
                        keep 10
                }
        }

}

4. How did you run Caddy (give the full command and describe the execution environment)?

/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp

5. What did you expect to see?

access.log with combined log format.

6. What did you see instead (give full error messages and/or log)?

no access.log file is generated to filesystem.

7. How can someone who is starting from scratch reproduce this behavior as minimally as possible?

If you do not use "{combined}" at Caddyfile, log file is generated and working with common log format.

Most helpful comment

There is a slightly odd format here where you need the path if you have more than just the file

so you should have

    log /  /var/log/caddy/minio/access.log "{combined}" {
            rotate {
                    size 128
                    age 14
                    keep 10
            }
    }

note the additional /after log. This should fix your issue.

All 2 comments

There is a slightly odd format here where you need the path if you have more than just the file

so you should have

    log /  /var/log/caddy/minio/access.log "{combined}" {
            rotate {
                    size 128
                    age 14
                    keep 10
            }
    }

note the additional /after log. This should fix your issue.

Thank you, it works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteffenDE picture SteffenDE  路  3Comments

billop picture billop  路  3Comments

la0wei picture la0wei  路  3Comments

klaasel picture klaasel  路  3Comments

kilpatty picture kilpatty  路  3Comments