Genbox / SimpleS3

A .NET Core implementation of Amazon's S3 API with focus on simplicity, security and performance
MIT License
50 stars 8 forks source link

DefaultRequestHandler error log is not informative #24

Closed LordMike closed 4 years ago

LordMike commented 4 years ago

We're seeing some of these errors.

Received error: 'Access Denied'. Details: ''

It would be more helpful to know of the resource that was denied access to, rather than some arbitrary extra metadata.

Also. Consider if the log level is appropriate.

https://github.com/Genbox/SimpleS3/blob/3c8560c73fee1997532a0d9c6336099131fd1955/src/SimpleS3.Core/Network/DefaultRequestHandler.cs#L209

Genbox commented 4 years ago

There are hundreds of errors, each with their own fields. The GetExtraData() you see is an attempt to take the most important fields so that you can get a user-friendly message. AccessDenied has not been mapped yet, which is why you don't see any extra data.

What I can do is add all the XML fields to the error base class (GenericError). Then you should be able to see all the extra information in the debugger. That should work for now, at least until most errors have been mapped for usability.

Genbox commented 4 years ago

What log level would you propose instead of LogError? It is an error after all.

LordMike commented 4 years ago

Error is probably fine - it's just odd as with a default filter of Information, no logs comes from the S3 Client, until this singular error with no details.