java - How to detectd that log4j not is not properly initialized -
I know that when neither log4j.properties nor log4j.xml are found on the classpath, we
log4j: Warnings for Lozaer (xxx) No Attendants can be found. Log4j: Start the Warning Log4j system properly.
How can I find out in Java so that I can execute some custom code? Example: To print something for my user?
You can check to see if any log4j attendants are configured in the classpath
logger LOGGER = Logger Tag (XXX.class); Count enum1 = LOGGER.getAllAppenders (); If (Enum1.hasMoreElements ()) {// Custom Print}
Comments
Post a Comment