Documentation ¶
Index ¶
Constants ¶
const (
// TokenF is a token field name that will be stripped from logs in production mode.
TokenF = "token"
)
Variables ¶
var IgnoredExceptions = []string{ responses.AuthRequiredErrorMessage, }
Functions ¶
func ErrorLoggingMiddleware ¶ added in v0.9.1
ErrorLoggingMiddleware intercepts panics and regular error responses from http handlers, handles them in a graceful way, logs and sends them to Sentry
func ErrorToSentry ¶ added in v0.13.6
ErrorToSentry sends to Sentry general exception info with some extra provided detail (like user email, claim url etc)
func LogSuccessfulQuery ¶
LogSuccessfulQuery takes a remote method name, execution time and params and logs it
Types ¶
type ModuleLogger ¶
TODO: we could drop the custom struct completely. it doesnt add anything anymore ModuleLogger contains module-specific logger details.
func NewModuleLogger ¶
func NewModuleLogger(moduleName string) ModuleLogger
NewModuleLogger creates a new ModuleLogger instance carrying module name for later `Log()` calls.
func (ModuleLogger) Disable ¶ added in v0.9.1
func (m ModuleLogger) Disable()
Disable turns off logging output for this module logger
func (ModuleLogger) Log ¶
func (m ModuleLogger) Log() *logrus.Entry
Log returns a new log entry for the module which can be called upon with a corresponding logLevel. Example:
Log().Info("query error")
func (ModuleLogger) WithFields ¶ added in v0.11.0
func (m ModuleLogger) WithFields(fields logrus.Fields) *logrus.Entry
WithFields returns a new log entry containing additional info provided by fields, which can be called upon with a corresponding logLevel. Example:
logger.WithFields(F{"query": "..."}).Info("query error")