本文整理汇总了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;未经允许,请勿转载。 |
请发表评论