From 0134790f5fbc6c73cbc36aa1c9ee94735c1b976b Mon Sep 17 00:00:00 2001 From: sjuarezgx Date: Mon, 12 Feb 2024 07:15:21 -0300 Subject: [PATCH] Add missing export to OTL exporter for Opentelemetry logging --- dotnet/src/dotnetcore/GxClasses/GxClasses.csproj | 1 + .../Services/LogService/OpenTelemetry/OtelLogProvider.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj b/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj index 3c17e8211..37eb56d95 100644 --- a/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj +++ b/dotnet/src/dotnetcore/GxClasses/GxClasses.csproj @@ -161,6 +161,7 @@ + diff --git a/dotnet/src/dotnetcore/GxClasses/Services/LogService/OpenTelemetry/OtelLogProvider.cs b/dotnet/src/dotnetcore/GxClasses/Services/LogService/OpenTelemetry/OtelLogProvider.cs index 21bb3d8f3..20fef179b 100644 --- a/dotnet/src/dotnetcore/GxClasses/Services/LogService/OpenTelemetry/OtelLogProvider.cs +++ b/dotnet/src/dotnetcore/GxClasses/Services/LogService/OpenTelemetry/OtelLogProvider.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging; using OpenTelemetry.Logs; using OpenTelemetry.Resources; +using OpenTelemetry.Exporter; namespace GeneXus.Services.Log { @@ -84,7 +85,9 @@ public static ILoggerFactory GetOpentelemetryLoggerFactory() var resourceBuilder = ResourceBuilder.CreateDefault() .AddTelemetrySdk(); - logging.SetResourceBuilder(resourceBuilder); + logging.SetResourceBuilder(resourceBuilder) + .AddOtlpExporter(); + if (GenerateOtelLogsToConsole()) logging.AddConsoleExporter();