Data from web Application not getting passed to ElasticSearch

限于喜欢 提交于 2019-12-24 21:34:39

问题


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.

Configuration looks like

<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>

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

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); –

回答1:


Try adding the property IncludeAllProperties=true to your target.



来源:https://stackoverflow.com/questions/53272531/data-from-web-application-not-getting-passed-to-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!