Switching off Log4j logging using JAVA
Sometimes we need to switch off logging done by Log4j API. In most of the cases console logging is given by default for external APIs using Log4j.We can turn it off through simple Java code.Following is the explanation.
Import following packages :
Given below is the code to turn it off
Logger log = Logger.getRootLogger();
}catch (Exception e)
System.out.println(“Error while turning off Log4j logger “+e.getMessage());