Java 类org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory 实例源码

项目:ymate-platform-v2    文件:DefaultLogger.java   
public synchronized ILogger init(ILog owner, String loggerName) throws Exception {
    if (!__inited) {
        __owner = owner;
        __loggerName = loggerName;
        //
        if (!__logInited) {
            ConfigurationSource _source = new ConfigurationSource(new FileInputStream(__owner.getModuleCfg().getConfigFile()));
            Configurator.initialize(null, _source);
            final Configuration _config = new DefaultConfiguration();
            ConfigurationFactory.setConfigurationFactory(new XmlConfigurationFactory() {
                public Configuration getConfiguration(ConfigurationSource source) {
                    return _config;
                }
            });
            ConfigurationFactory.getInstance().getConfiguration(_source);
            __logInited = true;
        }
        __logger = LogManager.getLogger(StringUtils.defaultIfBlank(loggerName, __owner.getModuleCfg().getLoggerName()));
        __inited = true;
    }
    return this;
}
项目:light    文件:JavaAgentTest.java   
@BeforeClass
public static void init()
{
    System.setProperty("LIGHT_HOME", LIGHT_AGENT_JAR_PATH + File.separator + ".." + File.separator + "install");
    System.setProperty("light.config", LIGHT_AGENT_JAR_PATH + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf");
    System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, LIGHT_AGENT_JAR_PATH + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "log4j2.xml");

    //        System.setProperty("java.class.path", System.getProperty("java.class.path") + File.pathSeparator + getAgentClassPath());
}
项目:light    文件:TestConfigure.java   
public static void load()
{
    System.setProperty("light.config", System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf");
    System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "log4j2.xml");

    System.setProperty("light.db.url", String.format("memory:%s/", Product.NAME.toLowerCase()));
    //        System.setProperty("light.db.url", "remote:localhost/");
    //        System.setProperty("light.db.url", String.format("plocal:../databases/%s/", Product.NAME.toLowerCase()));
}
项目:light    文件:ProfilerModuleTest.java   
@BeforeClass
public static void init()
{
    System.setProperty("light.config", System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf");
    System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "log4j2.xml");

    System.setProperty("server.database.path", System.getProperty("user.dir") + File.separator + "databases");
    System.setProperty("light.repository.config", REPOSITORY_CONFIG);
}
项目:light    文件:VirtualMachineAttacheTest.java   
@BeforeClass
public static void init()
{
    System.setProperty("LIGHT_HOME", System.getProperty("user.dir") + File.separator + ".." + File.separator + "install");
    System.setProperty("light.config", System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "light.conf");
    System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "log4j2.xml");
}
项目:light    文件:AnalysisTest.java   
@BeforeClass
public static void init()
{
    System.setProperty("flow.db.path", String.format("plocal:%s%s", System.getProperty("user.dir"), replaceWindowsSeparator(DEFAULT_PATH)));
    System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, System.getProperty("user.dir") + replaceWindowsSeparator(LOGFILE_PATH));

    factory = RepositoryFactory.getInstance("flowtest");
}
项目:light    文件:EntryPointTransformerTest.java   
@BeforeClass
public static void init()
{
    System.setProperty(XmlConfigurationFactory.CONFIGURATION_FILE_PROPERTY, System.getProperty("user.dir") + replaceWindowsSeparator(LOGFILE_PATH));
}