本文整理汇总了Java中org.apache.logging.log4j.util.PropertiesUtil.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java PropertiesUtil.getProperties方法的具体用法?Java PropertiesUtil.getProperties怎么用?Java PropertiesUtil.getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.logging.log4j.util.PropertiesUtil
的用法示例。
在下文中一共展示了PropertiesUtil.getProperties方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.logging.log4j.util.PropertiesUtil; //导入方法依赖的package包/类
/**
* <em>Consider private, used for testing.</em>
*/
static void init() {
ThreadContextMapFactory.init();
contextMap = null;
final PropertiesUtil managerProps = PropertiesUtil.getProperties();
disableAll = managerProps.getBooleanProperty(DISABLE_ALL);
useStack = !(managerProps.getBooleanProperty(DISABLE_STACK) || disableAll);
useMap = !(managerProps.getBooleanProperty(DISABLE_MAP) || disableAll);
contextStack = new DefaultThreadContextStack(useStack);
if (!useMap) {
contextMap = new NoOpThreadContextMap();
} else {
contextMap = ThreadContextMapFactory.createThreadContextMap();
}
if (contextMap instanceof ReadOnlyThreadContextMap) {
readOnlyContextMap = (ReadOnlyThreadContextMap) contextMap;
} else {
readOnlyContextMap = null;
}
}
示例2: main
import org.apache.logging.log4j.util.PropertiesUtil; //导入方法依赖的package包/类
public static void main() {
PrintStream ps = new PrintStream(new FileOutputStream(FileDescriptor.out));
MyTown.instance = new MyTown();
MyTown.instance.LOG = new SimpleLogger("MyTown2-Test", Level.INFO, true, true, false, false, "DD/MM/YY", null, PropertiesUtil.getProperties(), ps);
ps = new PrintStream(new FileOutputStream(FileDescriptor.out));
MyEssentialsCore.instance = new MyEssentialsCore();
MyEssentialsCore.instance.LOG = new SimpleLogger("MyEssentials-Core-Test", Level.INFO, true, true, false, false, "DD/MM/YY", null, PropertiesUtil.getProperties(), ps);
}
示例3: createDiscardingAsyncQueueFullPolicy
import org.apache.logging.log4j.util.PropertiesUtil; //导入方法依赖的package包/类
private static AsyncQueueFullPolicy createDiscardingAsyncQueueFullPolicy() {
final PropertiesUtil util = PropertiesUtil.getProperties();
final String level = util.getStringProperty(PROPERTY_NAME_DISCARDING_THRESHOLD_LEVEL, Level.INFO.name());
final Level thresholdLevel = Level.toLevel(level, Level.INFO);
LOGGER.debug("Creating custom DiscardingAsyncQueueFullPolicy(discardThreshold:{})", thresholdLevel);
return new DiscardingAsyncQueueFullPolicy(thresholdLevel);
}
示例4: init
import org.apache.logging.log4j.util.PropertiesUtil; //导入方法依赖的package包/类
/**
* Initializes static variables based on system properties. Normally called when this class is initialized by the VM
* and when Log4j is reconfigured.
*/
static void init() {
final PropertiesUtil properties = PropertiesUtil.getProperties();
initialCapacity = properties.getIntegerProperty(PROPERTY_NAME_INITIAL_CAPACITY, DEFAULT_INITIAL_CAPACITY);
inheritableMap = properties.getBooleanProperty(INHERITABLE_MAP);
}
示例5: initPrivate
import org.apache.logging.log4j.util.PropertiesUtil; //导入方法依赖的package包/类
/**
* Initializes static variables based on system properties. Normally called when this class is initialized by the VM
* and when Log4j is reconfigured.
*/
private static void initPrivate() {
final PropertiesUtil properties = PropertiesUtil.getProperties();
ThreadContextMapName = properties.getStringProperty(THREAD_CONTEXT_KEY);
GcFreeThreadContextKey = properties.getBooleanProperty(GC_FREE_THREAD_CONTEXT_KEY);
}
示例6: useAnsiEscapeCodes
import org.apache.logging.log4j.util.PropertiesUtil; //导入方法依赖的package包/类
private boolean useAnsiEscapeCodes() {
PropertiesUtil propertiesUtil = PropertiesUtil.getProperties();
boolean isPlatformSupportsAnsi = !propertiesUtil.isOsWindows();
boolean isJansiRequested = !propertiesUtil.getBooleanProperty("log4j.skipJansi", true);
return isPlatformSupportsAnsi || isJansiRequested;
}