add noLog4jDefaultConf parameter

This commit is contained in:
mdoboi 2011-04-22 14:51:23 +02:00
parent 80016c67c7
commit 0a3f546638
1 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,8 @@ public class SigarLog {
private static final int LOG_INFO = 3; private static final int LOG_INFO = 3;
private static final int LOG_DEBUG = 4; private static final int LOG_DEBUG = 4;
private static final boolean enableLogFallbackConf = ! Boolean.getBoolean("sigar.noLog4jDefaultConfig");
private static native void setLogger(Sigar sigar, Logger log); private static native void setLogger(Sigar sigar, Logger log);
public static native void setLevel(Sigar sigar, int level); public static native void setLevel(Sigar sigar, int level);
@ -48,7 +50,7 @@ public class SigarLog {
public static Logger getLogger(String name) { public static Logger getLogger(String name) {
Logger log = Logger.getLogger(name); Logger log = Logger.getLogger(name);
if (!isLogConfigured()) { if (enableLogFallbackConf && !isLogConfigured()) {
BasicConfigurator.configure(); BasicConfigurator.configure();
} }
return log; return log;