Turn Off Apache Common Logging
As others have pointed out, this is happening because you create the Log object before you set the property.
One way around this would be to set the property in your Main
class' static initialiser block - this will be run when the class is first loaded, and before the static final Log is created:
public class Main {
static {
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.NoOpLog");
}
// Rest of class as before
}
As others pointed out, your log
instance is instantiated before system property is set, which is too early.
Try passing -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
to your JVM to make sure it is set at the right time.