From 7fe5c793887862f37fef78f6bbe37334815556ab Mon Sep 17 00:00:00 2001 From: Dionne Meehan Date: Tue, 28 Jun 2022 10:15:39 +0100 Subject: [PATCH] only adding console logger in dev environment --- src/Logging/InitializationLogger.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Logging/InitializationLogger.cs b/src/Logging/InitializationLogger.cs index 37b3b1c1..7d028902 100644 --- a/src/Logging/InitializationLogger.cs +++ b/src/Logging/InitializationLogger.cs @@ -24,7 +24,11 @@ namespace Microsoft.Omex.Extensions.Logging private static ILoggingBuilder LoadInitializationLogger(this ILoggingBuilder builder) { - builder.AddConsole(); + if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development") + { + builder.AddConsole(); + } + builder.AddOmexLogging(); return builder; }