I am trying to add logging to .net core web api using graylog sink. The desired output is to have same as on the console using formmater like this one:
"[{Timestamp:HH:mm:ss} {Level:u3}] {EventId} {Message:lj} {Properties}{NewLine}{Exception}{NewLine}")
which produces that output:
[18:10:03 INF] { Id: 2 } Request finished in 876.4304ms 200
text/plain; charset=utf-8 {ElapsedMilliseconds=876.4304,
StatusCode=200, ContentType="text/plain; charset=utf-8",
SourceContext="Microsoft.AspNetCore.Hosting.Internal.WebHost",
RequestId="0HLL72NNJ19OK:00000001", RequestPath="/geo/allmenu",
CorrelationId=null, ConnectionId="0HLL72NNJ19OK"}
My sink configuration for graylog :
var graylogConfig = new GraylogSinkConfiguration
{
Host = "10.1.1.100",
Port = 12201,
UseSecureConnection = false,
UseAsyncLogging = true,
GraylogTransportType = GraylogTransportType.Tcp,
RetryCount = 20,
PropertyPrefix = "webapi",
};
Unfortunately, I cannot see any enriched data in graylog sink and wondering how I could provide formatter for this sink?