summaryrefslogtreecommitdiff
path: root/caddytest/integration
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest/integration')
-rw-r--r--caddytest/integration/caddyfile_adapt/global_options_log_and_site.txt77
-rw-r--r--caddytest/integration/caddyfile_adapt/global_options_log_basic.txt18
-rw-r--r--caddytest/integration/caddyfile_adapt/global_options_log_custom.txt39
-rw-r--r--caddytest/integration/caddyfile_adapt/global_options_log_multi.txt26
4 files changed, 160 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/global_options_log_and_site.txt b/caddytest/integration/caddyfile_adapt/global_options_log_and_site.txt
new file mode 100644
index 0000000..037c8b6
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/global_options_log_and_site.txt
@@ -0,0 +1,77 @@
+{
+ log {
+ output file caddy.log
+ include some-log-source
+ exclude admin.api admin2.api
+ }
+ log custom-logger {
+ output file caddy.log
+ level WARN
+ include custom-log-source
+ }
+}
+
+:8884 {
+ log {
+ format json
+ output file access.log
+ }
+}
+----------
+{
+ "logging": {
+ "logs": {
+ "custom-logger": {
+ "writer": {
+ "filename": "caddy.log",
+ "output": "file"
+ },
+ "level": "WARN",
+ "include": [
+ "custom-log-source"
+ ]
+ },
+ "default": {
+ "writer": {
+ "filename": "caddy.log",
+ "output": "file"
+ },
+ "include": [
+ "some-log-source"
+ ],
+ "exclude": [
+ "admin.api",
+ "admin2.api",
+ "custom-log-source",
+ "http.log.access.log0"
+ ]
+ },
+ "log0": {
+ "writer": {
+ "filename": "access.log",
+ "output": "file"
+ },
+ "encoder": {
+ "format": "json"
+ },
+ "include": [
+ "http.log.access.log0"
+ ]
+ }
+ }
+ },
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":8884"
+ ],
+ "logs": {
+ "default_logger_name": "log0"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/caddytest/integration/caddyfile_adapt/global_options_log_basic.txt b/caddytest/integration/caddyfile_adapt/global_options_log_basic.txt
new file mode 100644
index 0000000..b8d32dc
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/global_options_log_basic.txt
@@ -0,0 +1,18 @@
+{
+ log {
+ output file foo.log
+ }
+}
+----------
+{
+ "logging": {
+ "logs": {
+ "default": {
+ "writer": {
+ "filename": "foo.log",
+ "output": "file"
+ }
+ }
+ }
+ }
+}
diff --git a/caddytest/integration/caddyfile_adapt/global_options_log_custom.txt b/caddytest/integration/caddyfile_adapt/global_options_log_custom.txt
new file mode 100644
index 0000000..abbca19
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/global_options_log_custom.txt
@@ -0,0 +1,39 @@
+{
+ log custom-logger {
+ format filter {
+ wrap console
+ fields {
+ common_log delete
+ request>remote_addr ip_mask {
+ ipv4 24
+ ipv6 32
+ }
+ }
+ }
+ }
+}
+----------
+{
+ "logging": {
+ "logs": {
+ "custom-logger": {
+ "encoder": {
+ "fields": {
+ "common_log": {
+ "filter": "delete"
+ },
+ "request\u003eremote_addr": {
+ "filter": "ip_mask",
+ "ipv4_cidr": 24,
+ "ipv6_cidr": 32
+ }
+ },
+ "format": "filter",
+ "wrap": {
+ "format": "console"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/caddytest/integration/caddyfile_adapt/global_options_log_multi.txt b/caddytest/integration/caddyfile_adapt/global_options_log_multi.txt
new file mode 100644
index 0000000..c20251a
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/global_options_log_multi.txt
@@ -0,0 +1,26 @@
+{
+ log first {
+ output file foo.log
+ }
+ log second {
+ format json
+ }
+}
+----------
+{
+ "logging": {
+ "logs": {
+ "first": {
+ "writer": {
+ "filename": "foo.log",
+ "output": "file"
+ }
+ },
+ "second": {
+ "encoder": {
+ "format": "json"
+ }
+ }
+ }
+ }
+}