Filebeat:轻量型日志采集器。
html
这里采用懒人安装,Docker容器化安装,安装前先保证本身已经安装Docker-compose,安装地址:https://github.com/deviantony/docker-elk.git,安装完访问服务地址:http://localhost:5601,http://localhost:9200.
ELK中文官方文档
Elasticsearch 权威指南中文版(2.x)
Kibana 中文手册(6.0)
好了,ELK内容到这里把!建议、最好看一首文档,就不要去看博客了,由于都是抄来抄去,想骂人。分割线
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------git
<?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" internalLogLevel="Warn" internalLogFile="internal-nlog.txt"> <extensions> <add assembly="NLog.Web.AspNetCore"/> </extensions > <variable name="logDirectory" value="${basedir}\logs\"/> <!--define various log targets--> <targets> <!--write logs to file--> <target xsi:type="File" name="allfile" fileName="${logDirectory}\nlog-all-${shortdate}.log" layout="${longdate}|${logger}|${uppercase:${level}}|${message} ${exception}" /> <target xsi:type="Network" name="elastic" keepConnection="false" address ="tcp://ip地址:5000" index="msglog-${shortdate}" layout="${longdate}|${logger}|${uppercase:${level}}|${message} ${exception}" /> /> <target xsi:type="Null" name="blackhole" /> </targets> <rules> <!--All logs, including from Microsoft--> <logger name="*" minlevel="Trace" writeTo="allfile" /> <!--Skip Microsoft logs and so log only own logs--> <logger name="Microsoft.*" minlevel="Trace" writeTo="blackhole" final="true" /> <logger name="*" minlevel="Trace" writeTo="elastic" /> </rules> </nlog>
注意:ip地址哪里的端口为你配置logstash的input地址:
github
ABP日志经过属性注入,直接看代码了
docker