aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddytest/integration/caddyfile_adapt/log_override_hostname.caddyfiletest
blob: 76162d5221c2d283f2250ba246f4639764a06505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
*.example.com {
	log {
		hostnames foo.example.com bar.example.com
		output file /foo-bar.txt
	}
	log {
		hostnames baz.example.com
		output file /baz.txt
	}
}

example.com:8443 {
	log {
		output file /port.txt
	}
}
----------
{
	"logging": {
		"logs": {
			"default": {
				"exclude": [
					"http.log.access.log0",
					"http.log.access.log1",
					"http.log.access.log2"
				]
			},
			"log0": {
				"writer": {
					"filename": "/foo-bar.txt",
					"output": "file"
				},
				"include": [
					"http.log.access.log0"
				]
			},
			"log1": {
				"writer": {
					"filename": "/baz.txt",
					"output": "file"
				},
				"include": [
					"http.log.access.log1"
				]
			},
			"log2": {
				"writer": {
					"filename": "/port.txt",
					"output": "file"
				},
				"include": [
					"http.log.access.log2"
				]
			}
		}
	},
	"apps": {
		"http": {
			"servers": {
				"srv0": {
					"listen": [
						":443"
					],
					"routes": [
						{
							"match": [
								{
									"host": [
										"*.example.com"
									]
								}
							],
							"terminal": true
						}
					],
					"logs": {
						"logger_mapping": {
							"bar.example.com": [
								"log0"
							],
							"baz.example.com": [
								"log1"
							],
							"foo.example.com": [
								"log0"
							]
						}
					}
				},
				"srv1": {
					"listen": [
						":8443"
					],
					"routes": [
						{
							"match": [
								{
									"host": [
										"example.com"
									]
								}
							],
							"terminal": true
						}
					],
					"logs": {
						"logger_mapping": {
							"example.com": [
								"log2"
							]
						}
					}
				}
			}
		}
	}
}