Java Log Service getting started series of tutorials-(1) slf4j getting started

Source: Internet
Author: User

1. Background

As one of Apache's open-source projects, slf4j is short for simple logging system for Java. It is a facacde that makes it easy to use various log systems using slf4j? In fact, it is a bit like a container in a broad sense. The design mode includes facade, which is usually translated into the appearance mode ). Slf4j is easy to use.

2. Download The slf4j API

Download through this link:

Http://www.slf4j.org/download.html

3. Set the class path

Create a Java project and add it to the class path.Slf4j-api-1.6.4.jar and slf4j-simple-1.6.4.jar.

4. A simple application of slf4j Hello WorldProgram

Import Org. slf4j. logger; import Org. slf4j. loggerfactory; public class helloworld {public static void main (string [] ARGs) {logger = loggerfactory. getlogger (helloworld. class); logger.info ("Hello World ");}}

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.