(o Options)
| 77 | } |
| 78 | |
| 79 | func createAccessLog(o Options) *AccessLogger { |
| 80 | l := logrus.New() |
| 81 | if o.AccessLogFormatter != nil { |
| 82 | l.Formatter = o.AccessLogFormatter |
| 83 | } else if o.AccessLogJSONEnabled { |
| 84 | if o.AccessLogJsonFormatter != nil { |
| 85 | l.Formatter = o.AccessLogJsonFormatter |
| 86 | } else { |
| 87 | l.Formatter = &logrus.JSONFormatter{TimestampFormat: dateFormat, DisableTimestamp: true} |
| 88 | } |
| 89 | } else { |
| 90 | l.Formatter = &accessLogFormatter{accessLogFormat} |
| 91 | } |
| 92 | l.Out = o.AccessLogOutput |
| 93 | l.Level = logrus.InfoLevel |
| 94 | |
| 95 | return &AccessLogger{ |
| 96 | stripQuery: o.AccessLogStripQuery, |
| 97 | log: l, |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func NewAccessLogger(o Options) *AccessLogger { |
| 102 | initApplicationLog(o) |
no test coverage detected
searching dependent graphs…