add slf4j via log4j 2 logging

This commit is contained in:
2017-02-05 09:53:25 +01:00
parent 175a866c90
commit 3722ba02b1
5 changed files with 61 additions and 22 deletions

View File

@@ -3,4 +3,10 @@ dependencies {
compile project(':pdb-api')
compile 'org.lucares:ludb:1.0.20170101101722'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.6'
compile 'org.apache.logging.log4j:log4j-api:2.8'
compile 'org.apache.logging.log4j:log4j-core:2.8'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.8'
}

View File

@@ -3,8 +3,13 @@ package org.lucares.performance.db;
import java.util.Optional;
import java.util.concurrent.BlockingQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class BlockingQueueIterator<E> implements BlockingIterator<E> {
private static final Logger LOGGER = LoggerFactory.getLogger(BlockingQueueIterator.class);
private final BlockingQueue<E> queue;
private boolean closed = false;
@@ -23,9 +28,12 @@ public final class BlockingQueueIterator<E> implements BlockingIterator<E> {
return Optional.empty();
}
LOGGER.trace("wait for next entry");
final E next = queue.take();
LOGGER.trace("received entry: {}", next);
if (next == poison) {
LOGGER.trace("received poison");
closed = true;
return Optional.empty();
}

View File

@@ -0,0 +1,13 @@
name = PropertiesConfig
appenders = console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%t] %c{1} - %msg%n
rootLogger.level = trace
rootLogger.appenderRef.stdout.ref = STDOUT