Skip to content

Commit

Permalink
Until the delayed handler is activated, drop anything below INFO level
Browse files Browse the repository at this point in the history
This is definitely not a perfect solution but keeping all the log
messages in memory sounds worse anyway.

(cherry picked from commit 7a89e04)
  • Loading branch information
gsmet committed Apr 7, 2021
1 parent 83759d6 commit e60d2de
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.logging.ErrorManager;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jboss.logmanager.ExtHandler;
import org.jboss.logmanager.ExtLogRecord;
Expand Down Expand Up @@ -66,6 +67,10 @@ protected void doPublish(final ExtLogRecord record) {
publishToNestedHandlers(record);
super.doPublish(record);
} else {
// until the handler is fully activated, we drop anything below the info level
if (record.getLevel().intValue() < Level.INFO.intValue()) {
return;
}
// Determine whether the queue was overrun
if (logRecords.size() >= queueLimit) {
reportError(
Expand Down

0 comments on commit e60d2de

Please sign in to comment.