mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	middleware/{log,errors}: output everything to stdout (#684)
Limit the options in both errors and log middleware, just output to stdout and let someone else (journald,docker) care about where to route the logs. This removes syslog and logging to a file. Fixes #573 #602
This commit is contained in:
		| @@ -13,18 +13,19 @@ func TestErrorsParse(t *testing.T) { | ||||
| 		expectedErrorHandler errorHandler | ||||
| 	}{ | ||||
| 		{`errors`, false, errorHandler{ | ||||
| 			LogFile: "stdout", | ||||
| 		}}, | ||||
| 		{`errors stdout`, false, errorHandler{ | ||||
| 			LogFile: "stdout", | ||||
| 		}}, | ||||
| 		{`errors errors.txt`, true, errorHandler{ | ||||
| 			LogFile: "", | ||||
| 		}}, | ||||
| 		{`errors errors.txt`, false, errorHandler{ | ||||
| 			LogFile: "errors.txt", | ||||
| 		}}, | ||||
| 		{`errors visible`, false, errorHandler{ | ||||
| 		{`errors visible`, true, errorHandler{ | ||||
| 			LogFile: "", | ||||
| 			Debug:   true, | ||||
| 		}}, | ||||
| 		{`errors { log visible }`, false, errorHandler{ | ||||
| 			LogFile: "", | ||||
| 			Debug:   true, | ||||
| 		{`errors { log visible }`, true, errorHandler{ | ||||
| 			LogFile: "stdout", | ||||
| 		}}, | ||||
| 	} | ||||
| 	for i, test := range tests { | ||||
| @@ -40,9 +41,5 @@ func TestErrorsParse(t *testing.T) { | ||||
| 			t.Errorf("Test %d expected LogFile to be %s, but got %s", | ||||
| 				i, test.expectedErrorHandler.LogFile, actualErrorsRule.LogFile) | ||||
| 		} | ||||
| 		if actualErrorsRule.Debug != test.expectedErrorHandler.Debug { | ||||
| 			t.Errorf("Test %d expected Debug to be %v, but got %v", | ||||
| 				i, test.expectedErrorHandler.Debug, actualErrorsRule.Debug) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user