lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [29/50] [abbrv] lucene-solr:jira/solr-11779: SOLR-12288: Add more MDC logging information to core admin requests
Date Tue, 08 May 2018 21:15:15 GMT
SOLR-12288: Add more MDC logging information to core admin requests


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8b9c2a31
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8b9c2a31
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8b9c2a31

Branch: refs/heads/jira/solr-11779
Commit: 8b9c2a3185d824a9aaae5c993b872205358729dd
Parents: ed948ef
Author: Varun Thacker <varun@apache.org>
Authored: Wed May 2 19:43:14 2018 -0700
Committer: Varun Thacker <varun@apache.org>
Committed: Wed May 2 23:36:50 2018 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                                               | 2 ++
 .../java/org/apache/solr/handler/admin/CoreAdminHandler.java   | 6 ++++++
 .../src/java/org/apache/solr/logging/MDCLoggingContext.java    | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8b9c2a31/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index b2235fd..b925fe1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -276,6 +276,8 @@ Other Changes
 
 * SOLR-12289: Add more MDC logging information to collection admin requests (Varun Thacker)
 
+* SOLR-12288: Add more MDC logging information to core admin requests (Varun Thacker)
+
 ==================  7.3.1 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8b9c2a31/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
index 8932c21..66dc39e 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
@@ -44,6 +44,7 @@ import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.CoreDescriptor;
 import org.apache.solr.handler.RequestHandlerBase;
+import org.apache.solr.logging.MDCLoggingContext;
 import org.apache.solr.metrics.SolrMetricManager;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
@@ -170,6 +171,11 @@ public class CoreAdminHandler extends RequestHandlerBase implements PermissionNa
       }
 
       final CallInfo callInfo = new CallInfo(this, req, rsp, op);
+      String coreName = req.getParams().get(CoreAdminParams.CORE);
+      if (coreName == null) {
+        coreName = req.getParams().get(CoreAdminParams.NAME);
+      }
+      MDCLoggingContext.setCoreName(coreName);
       if (taskId == null) {
         callInfo.call();
       } else {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8b9c2a31/solr/core/src/java/org/apache/solr/logging/MDCLoggingContext.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/logging/MDCLoggingContext.java b/solr/core/src/java/org/apache/solr/logging/MDCLoggingContext.java
index 1f5324b..2276a9e6 100644
--- a/solr/core/src/java/org/apache/solr/logging/MDCLoggingContext.java
+++ b/solr/core/src/java/org/apache/solr/logging/MDCLoggingContext.java
@@ -69,7 +69,7 @@ public class MDCLoggingContext {
     }
   }
   
-  private static void setCoreName(String core) {
+  public static void setCoreName(String core) {
     if (core != null) {
       MDC.put(CORE_NAME_PROP, "x:" + core);
     } else {


Mime
View raw message