Initial version
This commit is contained in:
33
EonaCat.LogStack.OpenTelemetryFlow/LogBuilder.cs
Normal file
33
EonaCat.LogStack.OpenTelemetryFlow/LogBuilder.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using EonaCat.LogStack.Configuration;
|
||||
using EonaCat.LogStack.Core;
|
||||
using EonaCat.LogStack.Flows;
|
||||
using OpenTelemetry.Exporter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace EonaCat.LogStack.Flows.WindowsEventLog
|
||||
{
|
||||
// This file is part of the EonaCat project(s) which is released under the Apache License.
|
||||
// See the LICENSE file or go to https://EonaCat.com/License for full license details.
|
||||
|
||||
public static class EonaCatLogStackExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Write to OpenTelemetry
|
||||
/// </summary>
|
||||
public static LogBuilder WriteToOpenTelemetry(this LogBuilder logBuilder,
|
||||
string serviceName,
|
||||
Uri endpoint,
|
||||
OtlpExportProtocol protocol = OtlpExportProtocol.Grpc,
|
||||
LogLevel minimumLevel = LogLevel.Trace)
|
||||
{
|
||||
logBuilder.AddFlow(new OpenTelemetryFlow(
|
||||
serviceName,
|
||||
endpoint,
|
||||
protocol,
|
||||
minimumLevel));
|
||||
return logBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user