mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-31 02:27:19 -04:00 
			
		
		
		
	* logging: Implement `add` encoder * Allow flatter config structure for `filter` & `add` * Rename to append * govulncheck was unhappy
		
			
				
	
	
		
			63 lines
		
	
	
		
			777 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			777 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| {
 | |
| 	log {
 | |
| 		format append {
 | |
| 			wrap json
 | |
| 			fields {
 | |
| 				wrap "foo"
 | |
| 			}
 | |
| 			env {env.EXAMPLE}
 | |
| 			int 1
 | |
| 			float 1.1
 | |
| 			bool true
 | |
| 			string "string"
 | |
| 		}
 | |
| 	}
 | |
| }
 | |
| 
 | |
| :80 {
 | |
| 	respond "Hello, World!"
 | |
| }
 | |
| ----------
 | |
| {
 | |
| 	"logging": {
 | |
| 		"logs": {
 | |
| 			"default": {
 | |
| 				"encoder": {
 | |
| 					"fields": {
 | |
| 						"bool": true,
 | |
| 						"env": "{env.EXAMPLE}",
 | |
| 						"float": 1.1,
 | |
| 						"int": 1,
 | |
| 						"string": "string",
 | |
| 						"wrap": "foo"
 | |
| 					},
 | |
| 					"format": "append",
 | |
| 					"wrap": {
 | |
| 						"format": "json"
 | |
| 					}
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	},
 | |
| 	"apps": {
 | |
| 		"http": {
 | |
| 			"servers": {
 | |
| 				"srv0": {
 | |
| 					"listen": [
 | |
| 						":80"
 | |
| 					],
 | |
| 					"routes": [
 | |
| 						{
 | |
| 							"handle": [
 | |
| 								{
 | |
| 									"body": "Hello, World!",
 | |
| 									"handler": "static_response"
 | |
| 								}
 | |
| 							]
 | |
| 						}
 | |
| 					]
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| } |