Open ythy opened 4 years ago
If missing rootLogger setting:
log4j.logger.com.imc.saml.SSOClient=WARN, A2
log4j.appender.A2=org.apache.log4j.ConsoleAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss:SSS} %m%n
Cause Error:
log4j:WARN No appenders could be found for logger (org.opensaml.core.config.InitializationService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Only see log in com.imc.saml.SSOClient
reference
To ensure that all loggers can eventually inherit a level, the root logger always has an assigned level. Below are four tables with various assigned level values and the resulting inherited levels according to the above rule.
Example 1
In example 1 above, only the root logger is assigned a level. This level value, Proot, is inherited by the other loggers X, X.Y and X.Y.Z.
Example 2
In example 2, all loggers have an assigned level value. There is no need for level inheritence.
Example 3
In example 3, the loggers root, X and X.Y.Z are assigned the levels Proot, Px and Pxyz respectively. The logger X.Y inherits its level value from its parent X.
Example 4
In example 4, the loggers root and X and are assigned the levels Proot and Px respectively. The loggers X.Y and X.Y.Z inherits their level value from their nearest parent X having an assigned level..
code
log4j.rootLogger
: The root logger resides at the top of the logger hierarchy.com.imc.saml.SSOClient
: That`s only a path of package