Log4j log priority

Source: Internet
Author: User

Log4j log priority

Previous Article: http://www.cnblogs.com/chyu/p/4280440.html

How can I set a slot error to the warn level ..

<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">    <layout class="org.apache.log4j.PatternLayout">        <param name="ConversionPattern" value="%d %-5p - [%C{1}] %m%n"/>    </layout></appender><root>    <level value="warn"/>    <appender-ref ref="STDOUT"/></root>

⊙ B Khan. When I excluded the xml file setting error, I commented out all the custom logger, and the result left a root-level logger, the root-level ending logger cannot be set too low. This is a mistake I made at the beginning .. at the beginning, the root cause of not outputting logs should be that I wrote an error in the package name corresponding to the custom logger, resulting that only root is outputting logs .. therefore, the normal log should be as follows:

<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">    <layout class="org.apache.log4j.PatternLayout">        <param name="ConversionPattern" value="%d %-5p - [%C{1}] %m%n"/>    </layout></appender>
<logger name="org.xxx">
<level value="DEBUG"/>
<appender-ref ref="STDOUT"/>
</logger>
<root>
<level value="WARN"/>
<appender-ref ref="STDOUT"/>
</root>

Today, I started to get this applet again. When I added the specified logger, I noticed that the logger package name commented out was wrong...

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.