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:
Miek Gieben 2017-05-31 20:28:53 +01:00 committed by GitHub
parent 6c774782e0
commit e261ac1a6e
9 changed files with 49 additions and 186 deletions

View file

@ -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)
}
}
}