serilog-sinks-elasticsearch icon indicating copy to clipboard operation
serilog-sinks-elasticsearch copied to clipboard

Logging message twice "ElasticsearchJsonFormatter"

Open ajay-verma-01 opened this issue 4 years ago • 0 comments
trafficstars

A few questions before you begin:

Is this an issue related to the Serilog core project or one of the sinks or community projects.
This issue list is intended for Serilog Elasticsearch Sink issues. If this issue relates to another sink or to the code project, please log on the related repository. Please use Gitter chat and Stack Overflow for discussions and questions.

-No

Does this issue relate to a new feature or an existing bug?

  • [ ] Bug

What version of Serilog.Formatting.Elasticsearch is affected? Please list the related NuGet package. 8.4.1

What is the target framework and operating system? See target frameworks & net standard matrix.

  • [ ] netCore 3.0

Please describe the current behavior? It is logging my message twice one as messagetemplate and another as message {"@timestamp":"2021-08-18T13:44:32.9126842-07:00","level":"Information","messageTemplate":"Client: ::1, Path: /api/testmodel/getdata","message":"Client: ::1, Path: /api/testmodel/getdata","fields":{"SourceContext":"LoggingMiddleware"}}

Please describe the expected behavior? It should log message only once.

If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem I have set the formatter in appsettings.json as "formatter": "Serilog.Formatting.Elasticsearch.ElasticsearchJsonFormatter, Serilog.Formatting.Elasticsearch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10"

I have overridden the default Microsoft logging. "MinimumLevel": { "Default": "Debug", "Override": { "Microsoft": "Error", "System": "Warning" } },

ajay-verma-01 avatar Aug 19 '21 00:08 ajay-verma-01