diff options
author | Francis Lavoie <lavofr@gmail.com> | 2020-05-11 18:41:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 16:41:11 -0600 |
commit | ef6e53bb5f521e4d400849b79bc72e89fe2a7484 (patch) | |
tree | d1190ba7f084ec1ec8b99a6c8ea8e30ec1dfdb21 /caddytest | |
parent | 35e1d92d588fadc8e5d619ffb81319dd8f7ba43a (diff) |
core: Add support for `d` duration unit (#3323)
* caddy: Add support for `d` duration unit
* Improvements to ParseDuration; add unit tests
Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
Diffstat (limited to 'caddytest')
-rw-r--r-- | caddytest/integration/caddyfile_adapt_test.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt_test.go b/caddytest/integration/caddyfile_adapt_test.go index c2ad892..98c81da 100644 --- a/caddytest/integration/caddyfile_adapt_test.go +++ b/caddytest/integration/caddyfile_adapt_test.go @@ -489,3 +489,53 @@ func TestGlobalOptions(t *testing.T) { } }`) } + +func TestLogRollDays(t *testing.T) { + caddytest.AssertAdapt(t, ` + :80 + + log { + output file /var/log/access.log { + roll_size 1gb + roll_keep 5 + roll_keep_for 90d + } + } + `, "caddyfile", `{ + "logging": { + "logs": { + "default": { + "exclude": [ + "http.log.access.log0" + ] + }, + "log0": { + "writer": { + "filename": "/var/log/access.log", + "output": "file", + "roll_keep": 5, + "roll_keep_days": 90, + "roll_size_mb": 954 + }, + "include": [ + "http.log.access.log0" + ] + } + } + }, + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":80" + ], + "logs": { + "default_logger_name": "log0" + } + } + } + } + } +}`) +} |