本文整理匯總了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));
}
示例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));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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);
}
示例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);
}
示例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()));
}
示例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()));
}