1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

[SG-419] Added logging to mobile push notifications (#2332)

* Added logging to push notifications.

* Added additional logging for testing push notifications.

* Removed package lock changes.

* Removed package lock changes.

* Renamed the property and added a description.

* Undid changes to LoggerFactory.

* Removed filter on Microsoft library logging.

Co-authored-by: Todd Martin <>
This commit is contained in:
Todd Martin
2022-10-19 10:22:40 -04:00
committed by GitHub
parent f445edb315
commit 63ae7c8b66
5 changed files with 30 additions and 8 deletions

View File

@ -54,16 +54,19 @@ public abstract class BaseIdentityClientService : IDisposable
protected async Task<TResult> SendAsync<TRequest, TResult>(HttpMethod method, string path, TRequest requestModel)
{
var fullRequestPath = string.Concat(Client.BaseAddress, path);
var tokenStateResponse = await HandleTokenStateAsync();
if (!tokenStateResponse)
{
_logger.LogError("Unable to send {method} request to {requestUri} because an access token was unable to be obtained", method.Method, fullRequestPath);
return default;
}
var message = new TokenHttpRequestMessage(requestModel, AccessToken)
{
Method = method,
RequestUri = new Uri(string.Concat(Client.BaseAddress, path))
RequestUri = new Uri(fullRequestPath)
};
try
{
@ -120,7 +123,7 @@ public abstract class BaseIdentityClientService : IDisposable
if (!response.IsSuccessStatusCode)
{
_logger.LogInformation("Unsuccessful token response with status code {StatusCode}", response.StatusCode);
_logger.LogInformation("Unsuccessful token response from {identity} for client {clientId} with status code {StatusCode}", IdentityClient.BaseAddress, _identityClientId, response.StatusCode);
if (response.StatusCode == HttpStatusCode.BadRequest)
{