当前位置: 首页>>代码示例>>Java>>正文


Java PropertiesUtil.getProperties方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:24,代码来源:ThreadContext.java

示例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);
}
 
开发者ID:MyEssentials,项目名称:MyTown2,代码行数:10,代码来源:TestMain.java

示例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);
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:8,代码来源:AsyncQueueFullPolicyFactory.java

示例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);
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:10,代码来源:GarbageFreeSortedArrayThreadContextMap.java

示例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);
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:10,代码来源:ThreadContextMapFactory.java

示例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;
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:7,代码来源:PatternLayout.java


注:本文中的org.apache.logging.log4j.util.PropertiesUtil.getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。