The Java environment log4j the configuration of the logging environment.

Source: Internet
Author: User

You need 4 jar packages first. As follows

Http://pan.baidu.com/s/1i4k3fiH

The following package is included in the interim and can be placed in the project Lib.

In addition to the need for a configuration file, the sharing link is as follows. Http://pan.baidu.com/s/1o7qy2Ky put the configuration file in the location. Name yourself, then go to the project and use it.

Import Org.slf4j.Logger;
Import Org.slf4j.LoggerFactory;



Private static final Logger log = Loggerfactory.getlogger (User.class);
@RequestMapping (value= "/showlist") public String Showlist (model model) {Log.info ("<<<<<<<< Home display start>>>>>>>> "," Usermanager "," showlist "); List<user>userlist=userdaoimpl.getlist (); Model.addattribute ("UserList", userlist); Log.info ("<<< <<<<< Home Display end>>>>>>>> "," Usermanager "," showlist "); return" index ";}

  

After that, please note that the XML file itself is going to configure the log file path. All right, so much for that.

The Java environment log4j the configuration of the logging environment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.