Documentation ¶
Index ¶
- Variables
- func CombinedDLogFormat(l *AccessLog) string
- func CombinedLogFormat(l *AccessLog) string
- func JSONLogFormat(l *AccessLog) string
- func New(loggers ...Logger) func(http.Handler) http.Handler
- func Wrap(next http.Handler, loggers ...Logger) http.Handler
- type AccessLog
- type FormatLogger
- type LogFormat
- type Logger
- type ResponseWriter
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CombinedDLogFormat ¶
func CombinedLogFormat ¶
func JSONLogFormat ¶
Types ¶
type AccessLog ¶
type AccessLog struct { RequestHeader http.Header `json:"-"` ResponseHeader http.Header `json:"-"` RemoteAddr string `json:"remote_addr,omitempty"` AccessedAt time.Time `json:"accessed_at,omitempty"` UserAgent string `json:"user_agent,omitempty"` Referer string `json:"referer,omitempty"` BasicAuthUser string `json:"basic_auth_user,omitempty"` Request string `json:"request,omitempty"` StatusCode int `json:"status_code,omitempty"` BodyByteSent int `json:"body_byte_sent,omitempty"` FirstSentAt time.Time `json:"first_sent_at,omitempty"` LastSentAt time.Time `json:"last_sent_at,omitempty"` FirstSentTime int64 `json:"first_sent_time,omitempty"` ResponseTime int64 `json:"response_time,omitempty"` }
func NewAccessLog ¶
func (*AccessLog) WriteResponseInfo ¶
func (l *AccessLog) WriteResponseInfo(w *ResponseWriter) *AccessLog
type FormatLogger ¶
func CombinedDLogger ¶
func CombinedDLogger(w io.Writer) FormatLogger
func CombinedLogger ¶
func CombinedLogger(w io.Writer) FormatLogger
func JSONLogger ¶
func JSONLogger(w io.Writer) FormatLogger
func (FormatLogger) WriteAccessLog ¶
func (logger FormatLogger) WriteAccessLog(l *AccessLog)
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter FirstWriteTime time.Time LastWriteTime time.Time StatusCode int BodyByteSent int }
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.