Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogDefaultDateFormat = time.RFC3339
LogDefaultDateFormat is the format used for date by the default Log instance.
View Source
var LogDefaultFormat = "{{.StartTime}} | {{.Status}} | \t {{.Duration}} | {{.Hostname}} | {{.Method}} {{.Path}} \n"
LogDefaultFormat is the format logged used by the default Log instance.
Functions ¶
This section is empty.
Types ¶
type ALogger ¶
type ALogger interface {
Println(v ...interface{})
Printf(format string, v ...interface{})
}
ALogger interface
type LogEntry ¶
type LogEntry struct {
StartTime string
Status int
Duration time.Duration
Hostname string
Method string
Path string
}
LogEntry is the structure passed to the template.
type Logger ¶
type Logger struct {
// LoggerInterface implements more log.Logger interface to be compatible with other implementations
ALogger
// contains filtered or unexported fields
}
Log is a middleware handler that logs the request as it goes in and the response as it goes out.
func NewLoggerWithStream ¶
NewLogger with io.writer returns a new Logger instance
func (*Logger) ServeHTTP ¶
func (l *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*Logger) SetDateFormat ¶
Click to show internal directories.
Click to hide internal directories.