Esempio n. 1
0
File: main.go Progetto: pressly/chi
func LogEntrySetField(r *http.Request, key string, value interface{}) {
	entry := middleware.GetLogEntry(r).(*StructuredLoggerEntry)
	entry.logger = entry.logger.WithField(key, value)
	middleware.WithLogEntry(r, entry)
}
Esempio n. 2
0
File: main.go Progetto: pressly/chi
func LogEntrySetFields(r *http.Request, fields map[string]interface{}) {
	entry := middleware.GetLogEntry(r).(*StructuredLoggerEntry)
	entry.logger = entry.logger.WithFields(fields)
	middleware.WithLogEntry(r, entry)
}
Esempio n. 3
0
File: main.go Progetto: pressly/chi
func GetLogEntry(r *http.Request) logrus.FieldLogger {
	entry := middleware.GetLogEntry(r).(*StructuredLoggerEntry)
	return entry.logger
}