diff --git a/core/src/main/java/hudson/logging/LogRecorder.java b/core/src/main/java/hudson/logging/LogRecorder.java
index 43b4cb4562fab9b04f6e587c958a411a55dca9df..2299a74027b72e8d7ca28c79d1eef10e310b8cd9 100644
--- a/core/src/main/java/hudson/logging/LogRecorder.java
+++ b/core/src/main/java/hudson/logging/LogRecorder.java
@@ -297,6 +297,12 @@ public class LogRecorder extends AbstractModelObject implements Saveable {
rsp.sendRedirect2(redirect);
}
+ @RequirePOST
+ public void doClear(StaplerRequest req, StaplerResponse rsp) throws IOException {
+ handler.clear();
+ rsp.sendRedirect2(".");
+ }
+
/**
* Loads the settings from a file.
*/
diff --git a/core/src/main/java/hudson/util/RingBufferLogHandler.java b/core/src/main/java/hudson/util/RingBufferLogHandler.java
index c7839d47ff74c7686821b71b1bac80e1cf4db006..19f48053d395983518ed4d201736ce4b9a52abe9 100644
--- a/core/src/main/java/hudson/util/RingBufferLogHandler.java
+++ b/core/src/main/java/hudson/util/RingBufferLogHandler.java
@@ -57,6 +57,11 @@ public class RingBufferLogHandler extends Handler {
}
}
+ public synchronized void clear() {
+ size = 0;
+ start = 0;
+ }
+
/**
* Returns the list view of {@link LogRecord}s in the ring buffer.
*
diff --git a/core/src/main/resources/hudson/logging/LogRecorder/index.jelly b/core/src/main/resources/hudson/logging/LogRecorder/index.jelly
index 4b663c90fb3d4f5e79c4a057cae2fd36e4a58834..6841b605493ab334130d0faff578ff3b48aea966 100644
--- a/core/src/main/resources/hudson/logging/LogRecorder/index.jelly
+++ b/core/src/main/resources/hudson/logging/LogRecorder/index.jelly
@@ -37,6 +37,10 @@ THE SOFTWARE.