Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StackdriverLogging ¶
func StackdriverLogging(config *Config) echo.MiddlewareFunc
StackdriverLogging is a echo-middleware suitable for Stackdriver logging using logrus
Types ¶
type Config ¶
type Config struct {
Logger *logrus.Logger
Skipper middleware.Skipper
RequestID RequestID
RequestIDKey string
LogLevel LogLevel
}
Config is configuration for this logging middleware
type ContextWithLogrus ¶
func (*ContextWithLogrus) Logger ¶
func (c *ContextWithLogrus) Logger() echo.Logger
type HTTPRequest ¶
type HTTPRequest struct {
RequestMethod string `json:"requestMethod"`
RequestURL string `json:"requestUrl"`
Status int `json:"status"`
UserAgent string `json:"userAgent"`
RemoteIP string `json:"remoteIp"`
Referer string `json:"referer"`
Latency string `json:"latency"`
Protocol string `json:"protocol"`
}
HTTPRequest is HTTPRequest
func NewHTTPRequest ¶
func NewHTTPRequest(c echo.Context, latency time.Duration) *HTTPRequest
NewHTTPRequest is NewHTTPRequest
type LogLevel ¶
LogLevel defines log level from context
func LogLevelConstantOf ¶
LogLevelConstantOf defines same log level for all context
func LogLevelFromStatus ¶
LogLevelFromStatus defines log level based on response status
Click to show internal directories.
Click to hide internal directories.