MCPcopy Create free account
hub / github.com/zalando/skipper / TestPresentAuditJSONWithCustomFormatter

Function TestPresentAuditJSONWithCustomFormatter

logging/access_test.go:325–340  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

323}
324
325func TestPresentAuditJSONWithCustomFormatter(t *testing.T) {
326 entry := testAccessEntry()
327 entry.Request.Header.Set(logFilter.UnverifiedAuditHeader, "c4ddfe9d-a0d3-4afb-bf26-24b9588731a0")
328 jsonFormatter := &logrus.JSONFormatter{
329 DisableTimestamp: true,
330 FieldMap: logrus.FieldMap{
331 logrus.FieldKeyLevel: "my_level",
332 logrus.FieldKeyMsg: "my_message",
333 }}
334 testAccessLog(
335 t,
336 entry,
337 `{"audit":"c4ddfe9d-a0d3-4afb-bf26-24b9588731a0","auth-user":"","duration":42,"flow-id":"","host":"127.0.0.1","method":"GET","my_level":"info","my_message":"","proto":"HTTP/1.1","referer":"","requested-host":"example.com","response-size":2326,"status":418,"timestamp":"10/Oct/2000:13:55:36 -0700","uri":"/apache_pb.gif","user-agent":""}`,
338 Options{AccessLogJSONEnabled: true, AccessLogJsonFormatter: jsonFormatter},
339 )
340}
341
342func TestAccessLogStripQuery(t *testing.T) {
343 entry := testAccessEntry()

Callers

nothing calls this directly

Calls 3

testAccessEntryFunction · 0.85
testAccessLogFunction · 0.85
SetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…