diff --git a/server/service/logging_queries.go b/server/service/logging_queries.go index 5cda206ce302..22e1e785cdcb 100644 --- a/server/service/logging_queries.go +++ b/server/service/logging_queries.go @@ -95,6 +95,15 @@ func (mw loggingMiddleware) NewQuery(ctx context.Context, p kolide.QueryPayload) loggedInUser = vc.Username() } defer func(begin time.Time) { + if query == nil { + _ = mw.loggerInfo(err).Log( + "method", "NewQuery", + "err", err, + "user", loggedInUser, + "took", time.Since(begin), + ) + return + } _ = mw.loggerInfo(err).Log( "method", "NewQuery", "err", err,