stay JAVA Backstage , One of the most frequently used tools is the code that outputs logs . In the beginning , I use it System.out.println()
Output log , It turns out that , The real God doesn't use it when it outputs logs . It's a kind of encapsulated code log.info();
I'm interested in this way of outputting logs . Only after research did we know , This is log4j For the output log api, Then in the company project , I use this tool class many times . But as time goes on , More and more I found out , There are many ways to output logs , such as logger.info();
log.error(); So I'm going to find out …

* The most primitive method System.out.println(“ Here is the output log ”);
* Common methods public class ApplicationStarter { // Create log implementation class package
org.slf4j.LoggerFactory org.slf4j.Logger; private static Logger logger =
LoggerFactory.getLogger(ApplicationStarter.class); public static void main(
String[] args) { SpringApplication.run(ApplicationStarter.class, args); // Print log
logger.debug("\n"+" Start successfully !---------------------------"); }
* PlayFrameWork The framework comes with a tool class Logger.info(“》》》 Successful execution ”); // From bag play.Logger
* Lombok Self logging tool @Slf4j @Configuration public class RedisConfig extends
CachingConfigurerSupport { log.info("test"); // From bag lombok.extern.slf4j.Slf4j }

Technology
©2020 ioDraw All rights reserved
Java exercises 1: Simply define a car class New photo album app launched by Microsoft : Using cross platform framework React Native to write Chapter two Fundamentals of programming Programming exercises pandas Time order of webpack Code segmentation import()Vue slot slot: Default slot , Named slot , Scope slot Fundamentals of data analysis ——R language ( Processing missing values )C++ Implementation of matrix meteor shower effect PostMan Advanced Usage , Interface MD5+Secret autograph Sign The 12th Blue Bridge Cup B group C/C++ Provincial competition