In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Springboot how to manage the log, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
SpringBoot add log management
one.
Recently, my own project wants a log recording function, and springboot itself has a built-in log function. However, if you want to input the desired log and output it to disk, and then archive it on a daily basis, or split up the log, etc., the self-contained log only has a simple function. Baidu has summarized it as follows, which is suitable for most application scenarios.
two.
Springboot's pom file will quote a parent.
Org.springframework.boot spring-boot-starter-parent 2.0.0.RELEASE
If you click on this parent, you will have a dependency.
Org.springframework.boot spring-boot-dependencies 2.0.0.RELEASE.. /.. / spring-boot-dependencies
Click on version 2.0, which gives you various integrated package dependencies and specifies the version number, one of which is as follows
Org.springframework.boot spring-boot-starter 2.0.0.RELEASE
Click in again.
Org.springframework.boot spring-boot-starter-logging 2.0.0.RELEASE compile
Click again, AHA, come out, these are the original log packages, so you don't have to rely on them any more, just use ok. The usage is as follows:
Ch.qos.logback logback-classic 1.2.3 compile org.apache.logging.log4j log4j-to-slf4j 2.10.0 compile org.slf4j jul-to-slf4j 1.7.25 compile rsion= "1.0" > which says, color log this thing, you have to download plug-ins, oh, how to? I don't know, , and then configure logging.config=classpath:log/logback-spring.xmllogging.path=D:/nmyslog/nmys logs in yml or properties in the same way as usual, except that this configuration is not only output on the console but also retained on disk, and info/debug/error/warn logs are distinguished, and is it helpful for you to read the above contents after archiving every day? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.