来自Web应用程序的数据未传递到ElasticSearch [英] Data from web Application not getting passed to ElasticSearch

查看:106
本文介绍了来自Web应用程序的数据未传递到ElasticSearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个.Net Web应用程序,我们已经在登录到csv文件.我们刚刚开始使用Elastic搜索记录日志.我能够在Kibana上看到日志,但是在这里看不到来自添加到LogEventInfo的应用程序的任何信息,尽管我可以看到contentLength根据发送的信息的长度而改变.我只能在Kibana中看到每个日志的http详细信息.你能告诉我可能是什么问题吗?

We have a .Net web application and we were already logging to csv file. We just started logging with Elastic search. I am able to see a log on Kibana but none of the information from application added to LogEventInfo is visible here though I can see that contentLength is changed based on length of information sent. I can only see http details in Kibana for each log. Can you let me know what could be the issue.

配置看起来像

<target name="elastic" xsi:type="BufferingWrapper" flushTimeout="5000">

  <target xsi:type="ElasticSearch" uri="http://<url>:<portNumber>/">

    <field name ="MachineName" layout="${machinename}" layoutType="System.String" />

  </target>

</target>

机器名称"之类的数据未显示在Kibana上,我可以在同时创建的csv日志中看到它.

Data like Machine Name is not shown on Kibana, I can see it in csv log created simultaneously.

nlog配置.配置部分中的规则以写入日志

nlog configuration. Rule in configuration section to write log

" <logger name="*" minLevel="Info" writeTo="elk" enabled="true" />" 

使用以下代码记录数据:

Data is logged using following code:

var theEvent= new LogEventInfo( logLevel,this.logger.Name,activityInfo.LogMessage // The message to log. ); 
theEvent.Properties[APPLICATION_NAME] = applicationName; 
theEvent.Properties[ACTIVITY_NAME] = activityInfo.ActivityName; 
this.logger.Log (theEvent); –

推荐答案

尝试将IncludeAllProperties = true属性添加到目标中.

Try adding the property IncludeAllProperties=true to your target.

这篇关于来自Web应用程序的数据未传递到ElasticSearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆