fix missing/wrong logging
1. Log the exception in PdbFileIterator with a logger instead of just printing it to stderr. 2. Increase log level for exceptions when inserting entries. 3. Log exception when creation of entry failed in TcpIngestor.
This commit is contained in:
@@ -8,9 +8,13 @@ import java.util.Queue;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.lucares.pdb.api.Entry;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PdbFileIterator implements Iterator<Entry>, AutoCloseable {
|
||||
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(PdbFileIterator.class);
|
||||
|
||||
private static final class EntrySupplier implements Supplier<Entry>, AutoCloseable {
|
||||
|
||||
private final Queue<PdbReader> pdbFiles;
|
||||
@@ -65,7 +69,7 @@ public class PdbFileIterator implements Iterator<Entry>, AutoCloseable {
|
||||
try {
|
||||
pdbFiles.poll().close();
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
LOGGER.warn("Closing pdb file failed.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class PerformanceDb implements AutoCloseable {
|
||||
} catch (final InvalidValueException | SyntaxException e) {
|
||||
|
||||
LOGGER.info("skipping entry: " + e.getMessage() + " : " + entry);
|
||||
LOGGER.debug("", e);
|
||||
LOGGER.info("", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user