In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to achieve springboot to elk to write a log, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say nothing, follow the editor to have a look.
Connect to the logstash in elk in springboot, then write the log with the specified index index, then use kibana to query and analyze the log, and use elasticsearch to save the log.
Add referenc
Implementation 'net.logstash.logback:logstash-logback-encoder:5.3'
Add configuration
% d {yyyy-MM-dd HH:mm:ss.SSS} [% thread]%-5level% logger {50} -% msg% n 127.0.0.1 logger 5000 {"appname": "elkDemo"}
Specify configuration
Server.port=81logging.config=classpath:logback-spring.xml
Logstash configuration Index
Input {tcp {port = > 5000 codec = > "json"} # # Add your filters / logstash plugins configuration hereoutput {elasticsearch {hosts = > "elasticsearch:9200" user = > "elastic" password = > "changeme" index = > "% {[appname]}"}}
Build an index in kibana
Index through the kiban menu: Management > Index patterns > Create index pattern, where the available index names are displayed.
The above is how to achieve springboot to write logs to elk. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.