mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	* logging: Implement `extra_log` handler * Rename to `log_append` * Rename `skip_log` to `log_skip` --------- Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
		
			
				
	
	
		
			72 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
:80 {
 | 
						|
	log
 | 
						|
 | 
						|
	vars foo foo
 | 
						|
 | 
						|
	log_append const bar
 | 
						|
	log_append vars foo
 | 
						|
	log_append placeholder {path}
 | 
						|
 | 
						|
	log_append /only-for-this-path secret value
 | 
						|
}
 | 
						|
----------
 | 
						|
{
 | 
						|
	"apps": {
 | 
						|
		"http": {
 | 
						|
			"servers": {
 | 
						|
				"srv0": {
 | 
						|
					"listen": [
 | 
						|
						":80"
 | 
						|
					],
 | 
						|
					"routes": [
 | 
						|
						{
 | 
						|
							"handle": [
 | 
						|
								{
 | 
						|
									"foo": "foo",
 | 
						|
									"handler": "vars"
 | 
						|
								}
 | 
						|
							]
 | 
						|
						},
 | 
						|
						{
 | 
						|
							"match": [
 | 
						|
								{
 | 
						|
									"path": [
 | 
						|
										"/only-for-this-path"
 | 
						|
									]
 | 
						|
								}
 | 
						|
							],
 | 
						|
							"handle": [
 | 
						|
								{
 | 
						|
									"handler": "log_append",
 | 
						|
									"key": "secret",
 | 
						|
									"value": "value"
 | 
						|
								}
 | 
						|
							]
 | 
						|
						},
 | 
						|
						{
 | 
						|
							"handle": [
 | 
						|
								{
 | 
						|
									"handler": "log_append",
 | 
						|
									"key": "const",
 | 
						|
									"value": "bar"
 | 
						|
								},
 | 
						|
								{
 | 
						|
									"handler": "log_append",
 | 
						|
									"key": "vars",
 | 
						|
									"value": "foo"
 | 
						|
								},
 | 
						|
								{
 | 
						|
									"handler": "log_append",
 | 
						|
									"key": "placeholder",
 | 
						|
									"value": "{http.request.uri.path}"
 | 
						|
								}
 | 
						|
							]
 | 
						|
						}
 | 
						|
					],
 | 
						|
					"logs": {}
 | 
						|
				}
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
}
 |