Java Log Framework log4j and SLF4J

Source: Internet
Author: User

1 Org.apache.log4j.ConsoleAppender (console) 2 org.apache.log4j.FileAppender (file) 3 org.apache.log4j.DailyRollingFileAppender (Generate a log file every day) 4 Org.apache.log4j.RollingFileAppender (creates a new file when the file size reaches the specified size) 5 org.apache.log4j.WriterAppender (send log information in stream format to any specified location)

The original tutorial links http://www.cnblogs.com/ywlaker/p/6124067.html.

Briefly summarize below:

1.LOG4J Basic Usage

1) Guide package;

2) Configure the log4j.properties file;

3) Write logger in Java class.

2.properties File Contents

1) Logger

2) Appender

2. Location of properties files in different types of projects and other configurations

1) Common Java or Spring engineering

2) SPRINGMVC Project

3) General web Engineering

Java Log Framework log4j and SLF4J

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.