summaryrefslogtreecommitdiff
path: root/caddytest/integration/caddyfile_adapt_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest/integration/caddyfile_adapt_test.go')
-rw-r--r--caddytest/integration/caddyfile_adapt_test.go50
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"
+ }
+ }
+ }
+ }
+ }
+}`)
+}