Eclipse Integration log4j2-2.3

Source: Internet
Author: User

Log4j2 and log4j differ on the configuration file and the introduction jar package, here is a memo, the version used here is Apache-log4j-2.3-bin.zip.


1, Apache-log4j-2.3-bin.zip Download:

Official website or: http://download.csdn.net/download/tterminator/9005991


2, need to introduce the JAR package

In addition to the presence of SLF4J in the jar package name, all other needs to be introduced.


3,log4j2 configuration file (official website log4j only support XML and JSON-formatted configuration files, no longer support log4j-properties type of key-value pair configuration file, which is the most distinguished from log4j), the configuration file name is called Log4j2.xml, the contents are as follows:

<?xml version= "1.0" encoding= "UTF-8"?> <configuration  status= "error" >    <appenders>      <console name= "Console" target= "System_out" >        <thresholdfilter level= "Debug" onmatch= "ACCEPT" Onmismatch= "DENY"/>        <patternlayout pattern= "%d{hh:mm:ss. SSS}%-5level%class{36}%l%M-%msg%xex%n "/>      </Console>      <file name=" log "filename=" Weiyj.log " Append= "true" >        <patternlayout pattern= "%d{hh:mm:ss. SSS}%-5level%class{36}%l%M-%msg%xex%n "/>      </File>    </appenders>    <loggers>      <root level= "Trace" >        <appender-ref ref= "log"/> <appender-ref ref=        "Console"/>      </root>    </loggers>  


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Eclipse Integration log4j2-2.3

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.