我已经设置了代码示例,但是无法使用serilog登录到带有验证的kibana。在这里,我已附上我的代码,请对其进行更正。
Log.Logger = new LoggerConfiguration()
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("myurl:9200"))
{
IndexFormat = "ChargeMasterlog-{yyyy.MM.dd}",
ModifyConnectionSettings = x => x.BasicAuthentication("username", "password"),
}).CreateLogger();
Log.Information("Hello, Serilog!");
Run Code Online (Sandbox Code Playgroud)