use log4j in pdb-ui

This commit is contained in:
2017-02-05 11:20:00 +01:00
parent 3722ba02b1
commit 0c9195011a
3 changed files with 12 additions and 8 deletions

View File

@@ -8,7 +8,10 @@ dependencies {
compile project(':performanceDb')
compile project(':pdb-plotting')
compile("org.springframework.boot:spring-boot-starter-web:1.5.1.RELEASE")
compile("org.springframework.boot:spring-boot-starter-web:1.5.1.RELEASE"){
exclude module: 'spring-boot-starter-logging'
}
compile("org.springframework.boot:spring-boot-starter-log4j2:1.5.1.RELEASE")
testCompile("org.springframework.boot:spring-boot-starter-test:1.5.1.RELEASE")
}

View File

@@ -11,7 +11,6 @@ import java.util.Optional;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.concurrent.BlockingQueue;
import java.util.logging.Logger;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
@@ -23,9 +22,11 @@ import org.lucares.pdb.api.Entry;
import org.lucares.pdb.api.GroupResult;
import org.lucares.pdb.api.Result;
import org.lucares.pdb.api.Tags;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PerformanceDb implements AutoCloseable, CollectionUtils {
private static final Logger LOGGER = Logger.getLogger(PerformanceDb.class.getCanonicalName());
private final static Logger LOGGER = LoggerFactory.getLogger(PerformanceDb.class);
private final TagsToFile tagsToFile;
@@ -84,7 +85,7 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils {
if (count % blocksize == 0) {
final long end = System.nanoTime();
final double duration = (end - start) / 1_000_000.0;
LOGGER.info("inserting the last " + blocksize + " took " + duration + " ms; " + Stats.duration
LOGGER.debug("inserting the last " + blocksize + " took " + duration + " ms; " + Stats.duration
+ "ms of " + Stats.count + " operations. total entries: " + count / 1_000_000.0
+ " million");
@@ -107,7 +108,7 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils {
LOGGER.info("Thread was interrupted. Aborting exectution.");
} finally {
tagsToFile.flush();
LOGGER.info("flushed all files.");
LOGGER.debug("flushed all files.");
}
}
@@ -159,7 +160,7 @@ public class PerformanceDb implements AutoCloseable, CollectionUtils {
try {
iterator.close();
} catch (final RuntimeException e) {
e.printStackTrace();
LOGGER.info("runtime exception while closing iterator", e);
}
});
return result;

View File

@@ -9,5 +9,5 @@ appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%t] %c
rootLogger.level = trace
rootLogger.appenderRef.stdout.ref = STDOUT
rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT