1
0
Fork 0

Revert "First stage of access logging middleware. Initially without any output appenders."

This reverts commit 73a1b172ed.
This commit is contained in:
Emile Vauge 2017-05-03 17:08:16 +02:00
parent a5384bae47
commit 82651985c4
No known key found for this signature in database
GPG key ID: D808B4C167352E59
9 changed files with 34 additions and 447 deletions

View file

@ -1,7 +1,6 @@
package middlewares
import (
"context"
"fmt"
"io/ioutil"
"net/http"
@ -11,7 +10,6 @@ import (
"runtime"
"testing"
"github.com/containous/traefik/middlewares/accesslog"
shellwords "github.com/mattn/go-shellwords"
"github.com/stretchr/testify/assert"
)
@ -66,15 +64,7 @@ func TestLogger(t *testing.T) {
},
}
// Temporary - until new access logger is fully implemented
// create the data table and populate frontend and backend
core := make(accesslog.CoreLogData)
logDataTable := &accesslog.LogData{Core: core, Request: r.Header}
logDataTable.Core[accesslog.FrontendName] = testFrontendName
logDataTable.Core[accesslog.BackendURL] = testBackendName
req := r.WithContext(context.WithValue(r.Context(), accesslog.DataTableKey, logDataTable))
logger.ServeHTTP(&logtestResponseWriter{}, req, LogWriterTestHandlerFunc)
logger.ServeHTTP(&logtestResponseWriter{}, r, LogWriterTestHandlerFunc)
if logdata, err := ioutil.ReadFile(logfilePath); err != nil {
fmt.Printf("%s\n%s\n", string(logdata), err.Error())