Need only one new Logfile appender..

boolean inspectorAppenderWasFound = false; for (Enumeration appenders = logger.getAllAppenders(); appenders.hasMoreElements(); ) { Appender appender = (Appender) appenders.nextElement(); String currentAppName = appender.getName(); if (currentAppName.equalsIgnoreCase(INSPECTOR_FILE_LOGGER )) inspectorAppenderWasFound = true; } if (inspectorAppenderWasFound == false) { // was not created before FileAppender fa = new FileAppender(); fa.setName(INSPECTOR_FILE_LOGGER); fa.setFile(LOGFILE_PATH); fa.setLayout(new PatternLayout(LOGFILE_PATTERN)); fa.setThreshold(Level.DEBUG); fa.setAppend(true); fa.activateOptions(); logger.addAppender(fa); }

Read More

Best comments in source code found

Best comments in source code found:    //When I wrote this, only God and I understood what I was doing //Now, God only knows       #define TRUE FALSE     //Happy debugging suckers   /**  * Always returns true.  */ public boolean isAvailable() {     return false; }     {   …

Read More

How to determine which jar a class is loaded from?

Did you ever encounter an runtime exception saying a method not found? How can the code compile if the method is not defined? Or after you made some changes to the code, you don't see it takes effect, even after you clean built, and redeploy for a couple of times? When these situations occurs, besides…

Read More

Chrome: How to Fix Waiting for Available Socket Chrome Error

If you are also annoying with this ‘Waiting for Available Socket‘ error in your chrome browser, then you must check this post on how to fix waiting for available socketschrome error easily. The main reason for this error is that you have used the maximum available socket. This generally happens when you load lots of images or camera…

Read More