logback-spring.xml
127.0.0.1:5044 1048576 UTC { "severity":"%level", "service": "%contextName", "pid": "${PID:-}", "thread": "%thread", "class": "%logger{40}", "rest": "%message->%ex{full}" }
1: cd config
2:vim springboot-log.conf
3:
input {
tcp {
port => 5044
codec => json_lines
}
}
output {
# stdout {
# codec => rubydebug
# }
elasticsearch {
hosts => ["localhost:9200"]
index => "springboot-logstash-%{+YYYY.MM.dd}"
}
}
4:rm -rf .lock
5:lsof -i:5044
6: kill -9 pid
7:bin/logstash -f config/springboot-log.conf
8:运行springboot项目,打印日志。
8:logstash获得日志



