当前位置: 首页>>代码示例>>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;未经允许,请勿转载。