mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: ensure logs consistency across Coder (#8083)
This commit is contained in:
@ -71,11 +71,11 @@ func (h *HTTPAuthorizer) Authorize(r *http.Request, action rbac.Action, object r
|
||||
internalError := new(rbac.UnauthorizedError)
|
||||
logger := h.Logger
|
||||
if xerrors.As(err, internalError) {
|
||||
logger = h.Logger.With(slog.F("internal", internalError.Internal()))
|
||||
logger = h.Logger.With(slog.F("internal_error", internalError.Internal()))
|
||||
}
|
||||
// Log information for debugging. This will be very helpful
|
||||
// in the early days
|
||||
logger.Warn(r.Context(), "unauthorized",
|
||||
logger.Warn(r.Context(), "requester is not authorized to access the object",
|
||||
slog.F("roles", roles.Actor.SafeRoleNames()),
|
||||
slog.F("actor_id", roles.Actor.ID),
|
||||
slog.F("actor_name", roles.ActorName),
|
||||
|
Reference in New Issue
Block a user