Revert "First stage of access logging middleware. Initially without any output appenders."
This reverts commit 73a1b172ed
.
This commit is contained in:
parent
a5384bae47
commit
82651985c4
9 changed files with 34 additions and 447 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue