diff --git a/serv_nginx/api_bb/internal/handlers/news_handler.go b/serv_nginx/api_bb/internal/handlers/news_handler.go index 0c4b251..593c4c9 100644 --- a/serv_nginx/api_bb/internal/handlers/news_handler.go +++ b/serv_nginx/api_bb/internal/handlers/news_handler.go @@ -81,7 +81,12 @@ func (h *NewsHandler) CreateNews(w http.ResponseWriter, r *http.Request) { userID, ok := r.Context().Value(middleware.UserIDKey).(uint) logger.Get().Info("userID", zap.Uint("userID", userID)) if !ok { - fmt.Printf("userid %d", userID) + h.logger.Warn("Failed to get userID from context in CreateReview", + zap.String("path", r.URL.Path), + zap.String("method", r.Method), + zap.String("remote_addr", r.RemoteAddr), + zap.Uint("userID", userID), + ) utils.RespondWithError(w, http.StatusUnauthorized, "Unauthorized") return }