Closed CwjXFH closed 5 years ago
The readme explains how to add additional fields to your logs, and there are also some samples that might help. The reason your first attempt isn't working is because your parameters don't match your message template. You might be better off with a log scope. You could use a middleware, similar to this one to attach additional fields to all of the logs made during the request.
using (_logger.BeginScope(new Dictionary<string, object>
{
["method"] = "...",
["url"] = "..."
}))
{
await _next.Invoke(context);
}
@mattwcole I got it,Thanks!
Hi, I use this package like this:
But, the info write into graylog like this: Where's the
new { Request = requestData, Elapsed = elapsed }
?I try solve this problem in this way:
But,it annot write
grayLogEntity
into Graylog.Finally,i try this way:
But,nothing write into graylog,:joy:
Please help me,thanks!