![](/img/trans.png)
[英]Serilog does not write logs to SQL Server using Serilog.Sinks.MssqlServer
[英]Serilog Elasticsearch logs not making it to the server (but buffering correctly)
我在 Windows IIS web 服务器上有一个本地托管的 ELK 堆栈(v7.0),并且日志没有发送到服务器。 Server is running, I can reach the reserved URL and get back the generic json package saying Elasticsearch is running and I can log into Kibana just fine, there's just no logs to see.
我在正在记录的应用程序中设置了一个 bufferBaseFilename,当我 go 到该位置时,日志实际上就在那里,正确索引和所有。 我想知道为什么它永远不会同步回服务器? 这似乎是一个连接问题,但所有网络内容都已检查。 我可能错过了一些简单的东西。 有什么想法吗? 如果您需要更多信息,请与我们联系!
此错误的常见来源是与您的 ES 版本不匹配的格式错误(模板)请求(例如,包含不推荐使用的字段)。 你可以尝试
DetectElasticsearchVersion
设置为true
RegisterTemplateFailure
设置为IndexAnyway
您可以像这样配置接收器:
var loggerConfig = new LoggerConfiguration()
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(...) ){
// ...
DetectElasticsearchVersion = true,
RegisterTemplateFailure = RegisterTemplateFailure.IndexAnyway
});
我遇到了这个问题,对我来说,是 w3wp.exe 进程阻止了一些早期的缓冲区日志推送到弹性搜索,之后的所有内容也都在队列中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.