Log4j - Real performer
I tried to find out the different scenarios with/out log4j... Really great output
consider the following code snippet,
import org.apache.log4j.Level;import org.apache.log4j.Logger;import org.apache.log4j.BasicConfigurator;
public class MyApp {
static Logger logger = Logger.getLogger(MyApp.class);
public static void main(String[] args) {
long start = System.currentTimeMillis();
// BasicConfigurator.configure(); //logger.setLevel(Level.DEBUG);
for (int i = 0; i <>
// logger.info("Entering application.");
// logger.info("Exiting application.");
System.out.println("Entering application.");
System.out.println("Exiting application.");
}
long end = System.currentTimeMillis();
System.out.println(end - start);
}
}
with this.. program ends in around 6500 milli secs
disable SOP and enable log and run in ERROR level - ends in around 40 milli secs
disable SOP and enable log and run in DEBUG level - ends in around 13000 milli secs