• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultLoggingFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中io.dropwizard.logging.DefaultLoggingFactory的典型用法代码示例。如果您正苦于以下问题:Java DefaultLoggingFactory类的具体用法?Java DefaultLoggingFactory怎么用?Java DefaultLoggingFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultLoggingFactory类属于io.dropwizard.logging包,在下文中一共展示了DefaultLoggingFactory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: applicationShouldStartUp

import io.dropwizard.logging.DefaultLoggingFactory; //导入依赖的package包/类
@Test
public void applicationShouldStartUp() throws Exception {
    environmentHelper.setEnv(new HashMap<String, String>() {{
        put("PORT", "50555");
        put("LOG_LEVEL", "ERROR");
        put("VERIFY_ENVIRONMENT", "COMPLIANCE_TOOL");
        put("MSA_METADATA_URL", "some-msa-metadata-url");
        put("MSA_ENTITY_ID", "some-msa-entity-id");
        put("SERVICE_ENTITY_IDS", "[\"http://some-service-entity-id\"]");
        put("SAML_SIGNING_KEY", TEST_RP_PRIVATE_SIGNING_KEY);
        put("SAML_PRIMARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
        put("SAML_SECONDARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
        put("CLOCK_SKEW", "PT5s");
    }});

    application.getTestSupport().before();

    VerifyServiceProviderConfiguration configuration = application.getConfiguration();

    assertThat(application.getLocalPort()).isEqualTo(50555);
    assertThat(((DefaultLoggingFactory) configuration.getLoggingFactory()).getLevel().toString()).isEqualTo("ERROR");
    assertThat(configuration.getHubSsoLocation().toString()).isEqualTo(HubEnvironment.COMPLIANCE_TOOL.getSsoLocation().toString());
    assertThat(configuration.getVerifyHubMetadata().getUri().toString()).isEqualTo(HubEnvironment.COMPLIANCE_TOOL.getMetadataUri().toString());
    assertThat(configuration.getVerifyHubMetadata().getExpectedEntityId()).isEqualTo("https://signin.service.gov.uk");
    assertThat(configuration.getMsaMetadata().getExpectedEntityId()).isEqualTo("some-msa-entity-id");
    assertThat(configuration.getMsaMetadata().getUri().toString()).isEqualTo("some-msa-metadata-url");
    assertThat(configuration.getServiceEntityIds()).containsExactly("http://some-service-entity-id");
    assertThat(configuration.getSamlSigningKey().getEncoded()).isEqualTo(decode(TEST_RP_PRIVATE_SIGNING_KEY));
    assertThat(configuration.getSamlPrimaryEncryptionKey().getEncoded()).isEqualTo(decode(TEST_RP_PRIVATE_ENCRYPTION_KEY));
    assertThat(configuration.getSamlSecondaryEncryptionKey().getEncoded()).isEqualTo(decode(TEST_RP_PRIVATE_ENCRYPTION_KEY));
    assertThat(configuration.getClockSkew()).isEqualTo(Duration.standardSeconds(5));
}
 
开发者ID:alphagov,项目名称:verify-service-provider,代码行数:33,代码来源:ApplicationConfigurationFeatureTests.java


示例2: applicationShouldStartUpWithListOfServiceEntityIds

import io.dropwizard.logging.DefaultLoggingFactory; //导入依赖的package包/类
@Test
public void applicationShouldStartUpWithListOfServiceEntityIds() throws Exception {
    environmentHelper.setEnv(new HashMap<String, String>() {{
        put("PORT", "50555");
        put("LOG_LEVEL", "ERROR");
        put("VERIFY_ENVIRONMENT", "COMPLIANCE_TOOL");
        put("MSA_METADATA_URL", "some-msa-metadata-url");
        put("MSA_ENTITY_ID", "some-msa-entity-id");
        put("SERVICE_ENTITY_IDS", "[\"http://some-service-entity-id\",\"http://some-other-service-entity-id\"]");
        put("SAML_SIGNING_KEY", TEST_RP_PRIVATE_SIGNING_KEY);
        put("SAML_PRIMARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
        put("SAML_SECONDARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
        put("CLOCK_SKEW", "PT5s");
    }});

    application.getTestSupport().before();

    VerifyServiceProviderConfiguration configuration = application.getConfiguration();

    assertThat(application.getLocalPort()).isEqualTo(50555);
    assertThat(((DefaultLoggingFactory) configuration.getLoggingFactory()).getLevel().toString()).isEqualTo("ERROR");
    assertThat(configuration.getHubSsoLocation().toString()).isEqualTo(HubEnvironment.COMPLIANCE_TOOL.getSsoLocation().toString());
    assertThat(configuration.getVerifyHubMetadata().getUri().toString()).isEqualTo(HubEnvironment.COMPLIANCE_TOOL.getMetadataUri().toString());
    assertThat(configuration.getVerifyHubMetadata().getExpectedEntityId()).isEqualTo("https://signin.service.gov.uk");
    assertThat(configuration.getMsaMetadata().getExpectedEntityId()).isEqualTo("some-msa-entity-id");
    assertThat(configuration.getMsaMetadata().getUri().toString()).isEqualTo("some-msa-metadata-url");
    assertThat(configuration.getServiceEntityIds()).containsExactly("http://some-service-entity-id", "http://some-other-service-entity-id");
    assertThat(configuration.getSamlSigningKey().getEncoded()).isEqualTo(decode(TEST_RP_PRIVATE_SIGNING_KEY));
    assertThat(configuration.getSamlPrimaryEncryptionKey().getEncoded()).isEqualTo(decode(TEST_RP_PRIVATE_ENCRYPTION_KEY));
    assertThat(configuration.getSamlSecondaryEncryptionKey().getEncoded()).isEqualTo(decode(TEST_RP_PRIVATE_ENCRYPTION_KEY));
    assertThat(configuration.getClockSkew()).isEqualTo(Duration.standardSeconds(5));
}
 
开发者ID:alphagov,项目名称:verify-service-provider,代码行数:33,代码来源:ApplicationConfigurationFeatureTests.java


示例3: initLogging

import io.dropwizard.logging.DefaultLoggingFactory; //导入依赖的package包/类
private LoggingReader initLogging(Configuration configuration) throws IOException
{
    Set<File> mainFiles = Sets.newHashSet();
    Set<File> archiveDirectories = Sets.newHashSet();
    LoggingFactory loggingFactory = configuration.getLoggingFactory();
    if ( loggingFactory instanceof DefaultLoggingFactory )
    {
        for ( AppenderFactory appenderFactory : ((DefaultLoggingFactory)loggingFactory).getAppenders() )
        {
            if ( appenderFactory instanceof FileAppenderFactory )
            {
                FileAppenderFactory fileAppenderFactory = (FileAppenderFactory)appenderFactory;
                if ( fileAppenderFactory.getCurrentLogFilename() != null )
                {
                    mainFiles.add(new File(fileAppenderFactory.getCurrentLogFilename()).getCanonicalFile());
                }

                if ( fileAppenderFactory.getArchivedLogFilenamePattern() != null )
                {
                    File archive = new File(fileAppenderFactory.getArchivedLogFilenamePattern()).getParentFile().getCanonicalFile();
                    archiveDirectories.add(archive);
                }
            }
        }
    }

    if ( (mainFiles.size() == 0) && (archiveDirectories.size() == 0) )
    {
        log.warn("No log files found in config");
    }

    return new LoggingReader(mainFiles, archiveDirectories);
}
 
开发者ID:soabase,项目名称:soabase,代码行数:34,代码来源:SoaBundle.java


示例4: setUpServer

import io.dropwizard.logging.DefaultLoggingFactory; //导入依赖的package包/类
@BeforeClass
public static void setUpServer() {
    DefaultLoggingFactory loggingFactory = (DefaultLoggingFactory) BITSHADOW_SERVER.getTestSupport().getConfiguration().getLoggingFactory();
    loggingFactory.setLevel(Level.DEBUG);
}
 
开发者ID:LittleMikeDev,项目名称:bitshadow,代码行数:6,代码来源:BitshadowServiceTestRunner.java


示例5: getLoggingFactory

import io.dropwizard.logging.DefaultLoggingFactory; //导入依赖的package包/类
@Override
@JsonProperty("logging")
@Value.Default
public LoggingFactory getLoggingFactory() {
  return new DefaultLoggingFactory();
}
 
开发者ID:HuygensING,项目名称:timbuctoo,代码行数:7,代码来源:TimbuctooConfiguration.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AvailableSettings类代码示例发布时间:2022-05-23
下一篇:
Java CacheFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap