當前位置: 首頁>>代碼示例>>Java>>正文


Java Level.ALL屬性代碼示例

本文整理匯總了Java中ch.qos.logback.classic.Level.ALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Level.ALL屬性的具體用法?Java Level.ALL怎麽用?Java Level.ALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在ch.qos.logback.classic.Level的用法示例。


在下文中一共展示了Level.ALL屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAppend

@Test
public void testAppend() {
    when(encoder.doEncode(any(ILoggingEvent.class))).thenReturn(new byte[]{0x00, 0x00});
    unit.start();
    final LoggingEvent evt = new LoggingEvent("fqcn",ctx.getLogger("logger"), Level.ALL, "message", null, new Object[0]);
    unit.append(evt);
    verify(deliveryStrategy).send(any(KafkaProducer.class), any(ProducerRecord.class), eq(evt), any(FailedDeliveryCallback.class));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:8,代碼來源:KafkaAppenderTest.java

示例2: testDeferredAppend

@Test
public void testDeferredAppend() {
    when(encoder.doEncode(any(ILoggingEvent.class))).thenReturn(new byte[]{0x00, 0x00});
    unit.start();
    final LoggingEvent deferredEvent = new LoggingEvent("fqcn",ctx.getLogger("org.apache.kafka.clients.logger"), Level.ALL, "deferred message", null, new Object[0]);
    unit.doAppend(deferredEvent);
    verify(deliveryStrategy, times(0)).send(any(KafkaProducer.class), any(ProducerRecord.class), eq(deferredEvent), any(FailedDeliveryCallback.class));
    final LoggingEvent evt = new LoggingEvent("fqcn",ctx.getLogger("logger"), Level.ALL, "message", null, new Object[0]);
    unit.doAppend(evt);
    verify(deliveryStrategy).send(any(KafkaProducer.class), any(ProducerRecord.class), eq(deferredEvent), any(FailedDeliveryCallback.class));
    verify(deliveryStrategy).send(any(KafkaProducer.class), any(ProducerRecord.class), eq(evt), any(FailedDeliveryCallback.class));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:12,代碼來源:KafkaAppenderTest.java

示例3: testDoEncode

@Test
public void testDoEncode() {
    final LoggerContext ctx = new LoggerContext();
    layout.setContext(ctx);
    layout.setPattern("prefix %msg");
    layout.start();
    final Logger logger = ctx.getLogger("logger");
    final LoggingEvent evt = new LoggingEvent("fqcn", logger, Level.ALL,"message", null, new Object[0]);
    assertThat(unit.doEncode(evt), equalTo("prefix message".getBytes()));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:10,代碼來源:LayoutKafkaMessageEncoderTest.java

示例4: shouldPartitionByHostName

@Test
public void shouldPartitionByHostName() {
    ctx.putProperty(CoreConstants.HOSTNAME_KEY, "localhost");
    unit.setContext(ctx);
    final ILoggingEvent evt = new LoggingEvent("fqcn", ctx.getLogger("logger"), Level.ALL, "msg", null, new Object[0]);
    Assert.assertThat(unit.createKey(evt), Matchers.equalTo(ByteBuffer.allocate(4).putInt("localhost".hashCode()).array()));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:7,代碼來源:HostNameKeyingStrategyTest.java

示例5: shouldPartitionByEventThreadName

@Test
public void shouldPartitionByEventThreadName() {
    ctx.setName(LOGGER_CONTEXT_NAME);
    unit.setContext(ctx);
    final ILoggingEvent evt = new LoggingEvent("fqcn", ctx.getLogger("logger"), Level.ALL, "msg", null, new Object[0]);
    Assert.assertThat(unit.createKey(evt), Matchers.equalTo(ByteBuffer.allocate(4).putInt(LOGGER_CONTEXT_NAME.hashCode()).array()));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:7,代碼來源:ContextNameKeyingStrategyTest.java

示例6: setLogLevel

/**
 * This method sets the log level (logback).
 */
public void setLogLevel() {
    logLevel = System.getProperty("logLevel", LOG_LEVEL_INFO);
    Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
    Level logLevelSetting;
    switch (logLevel.toLowerCase()) {
    case LOG_LEVEL_ERROR:
        logLevelSetting = Level.ERROR;
        break;
    case LOG_LEVEL_WARN:
        logLevelSetting = Level.WARN;
        break;
    case LOG_LEVEL_ALL:
        logLevelSetting = Level.ALL;
        break;
    case LOG_LEVEL_TRACE_LOG:
        logLevelSetting = Level.TRACE;
        break;
    case LOG_LEVEL_INFO:
        logLevelSetting = Level.INFO;
        break;
    case LOG_LEVEL_DEBUG:
        logLevelSetting = Level.DEBUG;
        break;
    default:
        logLevelSetting = Level.INFO;
        break;
    }
    root.setLevel(logLevelSetting);
}
 
開發者ID:HotelsDotCom,項目名稱:heat,代碼行數:32,代碼來源:LoggingUtils.java

示例7: testAppendOneEvent

@Test
public void testAppendOneEvent() {
	nifiAppender.start();
	final LoggingEvent evt = new LoggingEvent("fqcn", loggerContext.getLogger("logger"), Level.ALL,
			"Test MessageToNifi", null, new Object[0]);
	nifiAppender.append(evt);
}
 
開發者ID:pradeepmvn,項目名稱:logback-nifi-appender,代碼行數:7,代碼來源:TestNifiAppender.java

示例8: shouldPartitionByLoggerName

@Test
public void shouldPartitionByLoggerName() {
    final ILoggingEvent evt = new LoggingEvent("fqcn", ctx.getLogger("logger"), Level.ALL, "msg", null, new Object[0]);
    Assert.assertThat(unit.createKey(evt), Matchers.equalTo(ByteBuffer.allocate(4).putInt("logger".hashCode()).array()));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:5,代碼來源:LoggerNameKeyingStrategyTest.java

示例9: shouldPartitionByEventThreadName

@Test
public void shouldPartitionByEventThreadName() {
    final String threadName = Thread.currentThread().getName();
    final ILoggingEvent evt = new LoggingEvent("fqcn", ctx.getLogger("logger"), Level.ALL, "msg", null, new Object[0]);
    Assert.assertThat(unit.createKey(evt), Matchers.equalTo(ByteBuffer.allocate(4).putInt(threadName.hashCode()).array()));
}
 
開發者ID:wngn123,項目名稱:wngn-jms-kafka,代碼行數:6,代碼來源:ThreadNameKeyingStrategyTest.java


注:本文中的ch.qos.logback.classic.Level.ALL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。