diff options
author | Harald Musum <musum@yahooinc.com> | 2022-10-05 12:19:50 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2022-10-05 12:19:50 +0200 |
commit | 5481b852bfa87af50d55d5063567cf8621170151 (patch) | |
tree | 5a5ba27dd1a720756003b4a0a877d9537bc6c87e /container-search | |
parent | 21e3a96edfc5b410fdab682d16242c90153bcfa5 (diff) |
Use correct logger and allow executor access from subclasses
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/logging/AbstractThreadedLogger.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/logging/AbstractThreadedLogger.java b/container-search/src/main/java/com/yahoo/search/logging/AbstractThreadedLogger.java index 5c14109b26e..1df236a037f 100644 --- a/container-search/src/main/java/com/yahoo/search/logging/AbstractThreadedLogger.java +++ b/container-search/src/main/java/com/yahoo/search/logging/AbstractThreadedLogger.java @@ -2,23 +2,22 @@ package com.yahoo.search.logging; -import org.slf4j.LoggerFactory; - import java.util.concurrent.Executor; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; abstract class AbstractThreadedLogger implements Logger { - private final static org.slf4j.Logger log = LoggerFactory.getLogger(AbstractThreadedLogger.class); + private final static java.util.logging.Logger log = java.util.logging.Logger.getLogger(AbstractThreadedLogger.class.getName()); final static int DEFAULT_MAX_THREADS = 1; final static int DEFAULT_QUEUE_SIZE = 1000; - private final WorkerThreadExecutor executor; + protected final WorkerThreadExecutor executor; AbstractThreadedLogger() { this(DEFAULT_MAX_THREADS, DEFAULT_QUEUE_SIZE); @@ -68,13 +67,13 @@ abstract class AbstractThreadedLogger implements Logger { try { super.run(); } catch (Exception e) { - log.error(String.format("Error while sending logger entry: %s", e), e); + log.log(Level.SEVERE, String.format("Error while sending logger entry: %s", e), e); } } } - private static class WorkerThreadExecutor implements Executor { + protected static class WorkerThreadExecutor implements Executor { protected final ThreadPoolExecutor executor; |