@@ -36,7 +36,7 @@ func (lm *loggingMiddleware) Issue(ctx context.Context, token string, key auth.K
3636 ),
3737 }
3838 if err != nil {
39- args = append (args , slog .Any ("error" , err ))
39+ args = append (args , slog .String ("error" , err . Error () ))
4040 lm .logger .Warn ("Issue key failed" , args ... )
4141 return
4242 }
@@ -53,7 +53,7 @@ func (lm *loggingMiddleware) Revoke(ctx context.Context, token, id string) (err
5353 slog .String ("key_id" , id ),
5454 }
5555 if err != nil {
56- args = append (args , slog .Any ("error" , err ))
56+ args = append (args , slog .String ("error" , err . Error () ))
5757 lm .logger .Warn ("Revoke key failed" , args ... )
5858 return
5959 }
@@ -70,7 +70,7 @@ func (lm *loggingMiddleware) RetrieveKey(ctx context.Context, token, id string)
7070 slog .String ("key_id" , id ),
7171 }
7272 if err != nil {
73- args = append (args , slog .Any ("error" , err ))
73+ args = append (args , slog .String ("error" , err . Error () ))
7474 lm .logger .Warn ("Retrieve key failed" , args ... )
7575 return
7676 }
@@ -90,7 +90,7 @@ func (lm *loggingMiddleware) Identify(ctx context.Context, token string) (id aut
9090 ),
9191 }
9292 if err != nil {
93- args = append (args , slog .Any ("error" , err ))
93+ args = append (args , slog .String ("error" , err . Error () ))
9494 lm .logger .Warn ("Identify key failed" , args ... )
9595 return
9696 }
@@ -116,7 +116,7 @@ func (lm *loggingMiddleware) Authorize(ctx context.Context, pr policies.Policy)
116116 slog .String ("permission" , pr .Permission ),
117117 }
118118 if err != nil {
119- args = append (args , slog .Any ("error" , err ))
119+ args = append (args , slog .String ("error" , err . Error () ))
120120 lm .logger .Warn ("Authorize failed" , args ... )
121121 return
122122 }
@@ -134,7 +134,7 @@ func (lm *loggingMiddleware) CreatePAT(ctx context.Context, token, name, descrip
134134 slog .String ("pat_duration" , duration .String ()),
135135 }
136136 if err != nil {
137- args = append (args , slog .Any ("error" , err ))
137+ args = append (args , slog .String ("error" , err . Error () ))
138138 lm .logger .Warn ("Create PAT failed" , args ... )
139139 return
140140 }
@@ -151,7 +151,7 @@ func (lm *loggingMiddleware) UpdatePATName(ctx context.Context, token, patID, na
151151 slog .String ("name" , name ),
152152 }
153153 if err != nil {
154- args = append (args , slog .Any ("error" , err ))
154+ args = append (args , slog .String ("error" , err . Error () ))
155155 lm .logger .Warn ("Update PAT name failed" , args ... )
156156 return
157157 }
@@ -168,7 +168,7 @@ func (lm *loggingMiddleware) UpdatePATDescription(ctx context.Context, token, pa
168168 slog .String ("description" , description ),
169169 }
170170 if err != nil {
171- args = append (args , slog .Any ("error" , err ))
171+ args = append (args , slog .String ("error" , err . Error () ))
172172 lm .logger .Warn ("Update PAT description failed" , args ... )
173173 return
174174 }
@@ -184,7 +184,7 @@ func (lm *loggingMiddleware) RetrievePAT(ctx context.Context, token, patID strin
184184 slog .String ("pat_id" , patID ),
185185 }
186186 if err != nil {
187- args = append (args , slog .Any ("error" , err ))
187+ args = append (args , slog .String ("error" , err . Error () ))
188188 lm .logger .Warn ("Retrieve PAT failed" , args ... )
189189 return
190190 }
@@ -201,7 +201,7 @@ func (lm *loggingMiddleware) ListPATS(ctx context.Context, token string, pm auth
201201 slog .Uint64 ("offset" , pm .Offset ),
202202 }
203203 if err != nil {
204- args = append (args , slog .Any ("error" , err ))
204+ args = append (args , slog .String ("error" , err . Error () ))
205205 lm .logger .Warn ("List PATS failed" , args ... )
206206 return
207207 }
@@ -219,7 +219,7 @@ func (lm *loggingMiddleware) ListScopes(ctx context.Context, token string, pm au
219219 slog .String ("pat_id" , pm .PatID ),
220220 }
221221 if err != nil {
222- args = append (args , slog .Any ("error" , err ))
222+ args = append (args , slog .String ("error" , err . Error () ))
223223 lm .logger .Warn ("List Scopes failed" , args ... )
224224 return
225225 }
@@ -235,7 +235,7 @@ func (lm *loggingMiddleware) DeletePAT(ctx context.Context, token, patID string)
235235 slog .String ("pat_id" , patID ),
236236 }
237237 if err != nil {
238- args = append (args , slog .Any ("error" , err ))
238+ args = append (args , slog .String ("error" , err . Error () ))
239239 lm .logger .Warn ("Delete PAT failed" , args ... )
240240 return
241241 }
@@ -252,7 +252,7 @@ func (lm *loggingMiddleware) ResetPATSecret(ctx context.Context, token, patID st
252252 slog .String ("pat_duration" , duration .String ()),
253253 }
254254 if err != nil {
255- args = append (args , slog .Any ("error" , err ))
255+ args = append (args , slog .String ("error" , err . Error () ))
256256 lm .logger .Warn ("Reset PAT secret failed" , args ... )
257257 return
258258 }
@@ -268,7 +268,7 @@ func (lm *loggingMiddleware) RevokePATSecret(ctx context.Context, token, patID s
268268 slog .String ("pat_id" , patID ),
269269 }
270270 if err != nil {
271- args = append (args , slog .Any ("error" , err ))
271+ args = append (args , slog .String ("error" , err . Error () ))
272272 lm .logger .Warn ("Revoke PAT secret failed" , args ... )
273273 return
274274 }
@@ -283,7 +283,7 @@ func (lm *loggingMiddleware) RemoveAllPAT(ctx context.Context, token string) (er
283283 slog .String ("duration" , time .Since (begin ).String ()),
284284 }
285285 if err != nil {
286- args = append (args , slog .Any ("error" , err ))
286+ args = append (args , slog .String ("error" , err . Error () ))
287287 lm .logger .Warn ("Remove all PAT failed" , args ... )
288288 return
289289 }
@@ -308,7 +308,7 @@ func (lm *loggingMiddleware) AddScope(ctx context.Context, token, patID string,
308308 slog .Group ("scope" , groupArgs ... ),
309309 }
310310 if err != nil {
311- args = append (args , slog .Any ("error" , err ))
311+ args = append (args , slog .String ("error" , err . Error () ))
312312 lm .logger .Warn ("Add PAT scope failed" , args ... )
313313 return
314314 }
@@ -329,7 +329,7 @@ func (lm *loggingMiddleware) RemoveScope(ctx context.Context, token, patID strin
329329 slog .Group ("scope" , groupArgs ... ),
330330 }
331331 if err != nil {
332- args = append (args , slog .Any ("error" , err ))
332+ args = append (args , slog .String ("error" , err . Error () ))
333333 lm .logger .Warn ("Remove entry from PAT scope failed" , args ... )
334334 return
335335 }
@@ -345,7 +345,7 @@ func (lm *loggingMiddleware) RemovePATAllScope(ctx context.Context, token, patID
345345 slog .String ("pat_id" , patID ),
346346 }
347347 if err != nil {
348- args = append (args , slog .Any ("error" , err ))
348+ args = append (args , slog .String ("error" , err . Error () ))
349349 lm .logger .Warn ("Remove all scopes from PAT failed" , args ... )
350350 return
351351 }
@@ -360,7 +360,7 @@ func (lm *loggingMiddleware) IdentifyPAT(ctx context.Context, paToken string) (p
360360 slog .String ("duration" , time .Since (begin ).String ()),
361361 }
362362 if err != nil {
363- args = append (args , slog .Any ("error" , err ))
363+ args = append (args , slog .String ("error" , err . Error () ))
364364 lm .logger .Warn ("Identify PAT failed" , args ... )
365365 return
366366 }
@@ -379,7 +379,7 @@ func (lm *loggingMiddleware) AuthorizePAT(ctx context.Context, userID, patID str
379379 slog .String ("entities" , entityID ),
380380 }
381381 if err != nil {
382- args = append (args , slog .Any ("error" , err ))
382+ args = append (args , slog .String ("error" , err . Error () ))
383383 lm .logger .Warn ("Authorize PAT failed complete successfully" , args ... )
384384 return
385385 }
0 commit comments