diff --git a/handlers/middleware.go b/handlers/middleware.go index 8a15e39e..7d8a84d8 100644 --- a/handlers/middleware.go +++ b/handlers/middleware.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/getsentry/sentry-go" "github.com/hunterlong/statping/types/core" "github.com/hunterlong/statping/utils" "io" @@ -81,21 +80,13 @@ func sendLog(next http.Handler) http.Handler { next.ServeHTTP(w, r) return } - t2 := utils.Now().Sub(t1) next.ServeHTTP(w, r) + t2 := utils.Now().Sub(t1) log.WithFields(utils.ToFields(w, r)). WithField("url", r.RequestURI). WithField("method", r.Method). WithField("load_micro_seconds", t2.Microseconds()). Infoln(fmt.Sprintf("%v (%v) | IP: %v", r.RequestURI, r.Method, r.Host)) - - e := sentry.NewEvent() - e.Timestamp = utils.Now().Unix() - e.Dist = "development" - e.Environment = "development" - e.Transaction = "http_response" - sentry.CaptureEvent(e) - }) } diff --git a/utils/log.go b/utils/log.go index 420d1069..0b8ba633 100644 --- a/utils/log.go +++ b/utils/log.go @@ -18,6 +18,7 @@ package utils import ( "fmt" "github.com/fatih/structs" + "github.com/getsentry/sentry-go" "github.com/hunterlong/statping/types/null" Logger "github.com/sirupsen/logrus" "gopkg.in/natefinch/lumberjack.v2" @@ -134,6 +135,8 @@ func InitLogs() error { }) checkVerboseMode() + sentry.CaptureMessage("It works!") + LastLines = make([]*logRow, 0) return nil }