Is your feature request related to a problem? Please describe.
Describe the solution you'd like
When you use the IExceptionLogger outside of a http context it throws an ArgumentNullException. You can pass in a null http context but it tries to resolve the context from the IHttpContextAccessor. If f it is not in a request scope the accessor returns null and then the method crashs.
This is strange because it seems that the request url and other request information are optional anyway:
https://github.com/googleapis/google-cloud-dotnet/blob/master/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore/ErrorReporting/HttpContextWrapper.cs#L35
I would make the http context really optional and the wrapper to this:
https://gist.github.com/SebastianStehle/294719e0cf2f2f6f71b808623b1b458c
This should be fixed by #4521 .
Thanks for reporting.
Most helpful comment
This should be fixed by #4521 .
Thanks for reporting.