-
Notifications
You must be signed in to change notification settings - Fork 8
Logging message from Otlp target is not picked up by LogRecord processor #29
Copy link
Copy link
Open
Description
In our application we have several processors in place to process the LogRecord (mainly enrich them).
I'm doing the experiment and see how does it the target pacakge work with NLog, I do notice that our LogRecord processor in the application (not the one in OTEL collector) does not pick up the LogRecord and enrich them. Is this by design? Or a missing feature?
A sample repro
Program.cs
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseStartup<Startup>()
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
})
.UseNLog();
});Startup.cs
services
.AddOpenTelemetry()
.WithLogging(builder =>
{
builder.AddProcessor<LogRecordTraceContextEnrichProcessor>();
builder.AddProcessor<LogRecordExceptionParsingProcessor>();
})appSettings.json
"NLog": {
"autoReload": false,
"throwConfigExceptions": true,
"internalLogLevel": "Info",
"extensions": [
{
"assembly": "NLog.Web.AspNetCore"
},
{
"assembly": "NLog.Targets.OpenTelemetryProtocol"
}
],
"targets": {
"consoleTarget": {
"type": "ColoredConsole"
},
"otlp": {
"type": "OtlpTarget",
"resolveOptionsFromName": "Logging",
"scheduledDelayMilliseconds": 1000
}
},
"rules": [
{
"logger": "*",
"minLevel": "Fatal",
"writeTo": "consoleTarget"
},
{
"logger": "*",
"minLevel": "Info",
"writeTo": "otlp"
}
]
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels