Open carlos0202 opened 3 years ago
Is this project abandoned/disbanded? Thanks in advance for any help on this.
Sorry for a really late reply. For some reason, I don't get notifications when somebody opens an issue. Kibana uses 2 separate fields:
Sorry for a really late reply. For some reason, I don't get notifications when somebody opens an issue. Kibana uses 2 separate fields:
- message = message template,
- rendered message = message with all placeholder values baked in. This way you can filter out all the messages by their template. Are you sure that there's no rendered message field in the Kibana logs?
Sorry for my late reply as well. Right now, only the message (message template) is being sent to Kibana. How can I Send both parameters to Kibana using NLog? My configuration is as follows:
And:
But the result is the following:
The JSON object sent is missing the rendered message property.
Hello @carlos0202 , I'm not an NLog expert, but it seems like structured logging using requires some additional configuration: https://github.com/NLog/NLog/wiki/How-to-use-structured-logging#using-structured-logging Since the console output is fine, the issue is probably with a JSON/ELK sink configuration. BTW, Serilog has structured logging out of the box and integrates with different sinks, including ELK in a few lines of code. I forgot when I saw other logging frameworks in modern projects the last time.
I configured Dapper.Logging library to log SQL Server Dapper queries but when checking logs on Kibanna the message is always shown as this: Dapper query: {query} Parameters: {params}, elapsed: {elapsed} ms, context: {@context}, connection: {@connection}
Startup config:
Console logs:
Kibana logs:
Expected result: The Kibana logged message should be the same as the console log.