Why is Java log4j.additivity canceling log inheritance invalid

Source: Internet
Author: User

Log4j1 Log Inheritance Description: slightly.

Short description of the problem: the package path behind "log4j.additivity" must be the same as the package path that follows the "Log4j.logger" in the other configuration, log4j will not analyze the package structure of your project.

For example: Consider canceling the inheritance of several logger under the Com.game.gmActivation.logger package, only output to the log in the specified path, and the wrong configuration is to write only one parent package path configuration:

    # Log of the following package path is de-inherited

    Log4j.additivity.com.game.gmactivation.logger=false

    # #行为日志定向配置
Log4j.logger.com.game.gmactivation.logger.gamecurrency=info,gamecurrencylog
Log4j.logger.com.game.gmactivation.logger.onlinerolenum=info,onlinerolenumlog
Log4j.logger.com.game.gmactivation.logger.itembuy=info,itembuylog
Log4j.logger.com.game.gmactivation.logger.zuanshiuse=info,zuanshiuselog
Log4j.logger.com.game.gmactivation.logger.gamesysactive=info,gamesysactivelog

  

The correct configuration is to enumerate all configurations, each of which corresponds.

     # Log of the following package path is de-inherited
Log4j.additivity.com.game.gmactivation.logger.gamecurrency=false
Log4j.additivity.com.game.gmactivation.logger.onlinerolenum=false
Log4j.additivity.com.game.gmactivation.logger.itembuy=false
Log4j.additivity.com.game.gmactivation.logger.zuanshiuse=false
Log4j.additivity.com.game.gmactivation.logger.gamesysactive=false
# #行为日志定向配置
Log4j.logger.com.game.gmactivation.logger.gamecurrency=info,gamecurrencylog
Log4j.logger.com.game.gmactivation.logger.onlinerolenum=info,onlinerolenumlog
Log4j.logger.com.game.gmactivation.logger.itembuy=info,itembuylog
Log4j.logger.com.game.gmactivation.logger.zuanshiuse=info,zuanshiuselog
Log4j.logger.com.game.gmactivation.logger.gamesysactive=info,gamesysactivelog

Welcome to leave a message.

Why is Java log4j.additivity canceling log inheritance invalid

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.