Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Serilog を使用して、構造化されたログ データを Logstash 経由で Elasticsearch に書き込みます。このようにログメッセージにオブジェクトを書き込む場合
Log.Information("This is the {@object}", new {Prop = "example"})
出力される JSON には、追加のプロパティ _typeTag が含まれます。このプロパティを除外することは可能ですか?
ITextFormatterSerilog で Elasticsearch にログを記録するときに、カスタムを指定することができます。のプロパティElasticsearchSinkOptionsは次のとおりです。
ITextFormatter
ElasticsearchSinkOptions
public ITextFormatter CustomFormatter { get; set; }
必要に応じてカスタム フォーマッタを構成するには、いくつかの作業が必要になる場合がありJsonFormatterますElasticsearchJsonFormatter。
JsonFormatter
ElasticsearchJsonFormatter