add slf4j via log4j 2 logging
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
13
performanceDb/src/main/resources/log4j2.properties
Normal file
13
performanceDb/src/main/resources/log4j2.properties
Normal 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
|
||||
Reference in New Issue
Block a user