(t *testing.T)
| 323 | } |
| 324 | |
| 325 | func 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 | |
| 342 | func TestAccessLogStripQuery(t *testing.T) { |
| 343 | entry := testAccessEntry() |
nothing calls this directly
no test coverage detected
searching dependent graphs…