From a8e12494637e7e3f254893776a86d5a0186cf3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Fri, 18 Oct 2024 10:19:09 +0200 Subject: [PATCH] refactor: change log level for warning when collection already exists --- Adaptors/MongoDB/src/Common/MongoCollectionProvider.cs | 6 +++--- Common/tests/Auth/AuthenticationIntegrationTest.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Adaptors/MongoDB/src/Common/MongoCollectionProvider.cs b/Adaptors/MongoDB/src/Common/MongoCollectionProvider.cs index b0513dc7c..b0d9a5e51 100644 --- a/Adaptors/MongoDB/src/Common/MongoCollectionProvider.cs +++ b/Adaptors/MongoDB/src/Common/MongoCollectionProvider.cs @@ -218,9 +218,9 @@ await model.InitializeCollectionAsync(session, } catch (MongoBulkWriteException e) when (e.WriteErrors.All(error => error.Category == ServerErrorCategory.DuplicateKey)) { - logger.LogWarning(e, - "Values were already present within the collection {CollectionName}", - model.CollectionName); + logger.LogDebug(e, + "Values were already present within the collection {CollectionName}", + model.CollectionName); break; } catch (Exception ex) diff --git a/Common/tests/Auth/AuthenticationIntegrationTest.cs b/Common/tests/Auth/AuthenticationIntegrationTest.cs index 84f67be6d..ed8f6a5de 100644 --- a/Common/tests/Auth/AuthenticationIntegrationTest.cs +++ b/Common/tests/Auth/AuthenticationIntegrationTest.cs @@ -422,7 +422,7 @@ public static Metadata GetHeaders(IdentityIndex index, { headers.Add(AuthenticatorOptions.DefaultAuth.ImpersonationIdHeader, (int)impersonate < 0 - ? "1000" + ? "404" : Identities[(int)impersonate] .UserId.ToString()); }