From 010d9e9067b7fa3ce776ec5f76a6cc4d0fdff258 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 26 Jul 2013 17:20:32 -0400 Subject: [PATCH] [FIXED JENKINS-18959] /log/all should not show FINE messages from custom loggers. --- changelog.html | 3 +++ core/src/main/java/hudson/WebAppMain.java | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 279a7b458b..972b7a86fe 100644 --- a/changelog.html +++ b/changelog.html @@ -84,6 +84,9 @@ Upcoming changes (issue 17302)
  • Clearer display of log messages: chronological order, and coloration of repeated vs. fresh metadata (date, log level, log source). +
  • + Ensuring /log/all shows only INFO and above messages, even if custom loggers display FINE or below. + (issue 18959)
  • Fixed a regression that broke some plugins' form validation (issue 18776) diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index 8475fe221c..f6cf979bf8 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -59,6 +59,7 @@ import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; import java.security.Security; +import java.util.logging.LogRecord; /** * Entry point when Hudson is used as a webapp. @@ -66,7 +67,13 @@ import java.security.Security; * @author Kohsuke Kawaguchi */ public final class WebAppMain implements ServletContextListener { - private final RingBufferLogHandler handler = new RingBufferLogHandler(); + private final RingBufferLogHandler handler = new RingBufferLogHandler() { + @Override public synchronized void publish(LogRecord record) { + if (record.getLevel().intValue() >= Level.INFO.intValue()) { + super.publish(record); + } + } + }; private static final String APP = "app"; private boolean terminated; private Thread initThread;