add noLog4jDefaultConf parameter
This commit is contained in:
parent
80016c67c7
commit
0a3f546638
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue