mirror of https://github.com/apache/lucene.git
SOLR-12288: Add more MDC logging information to core admin requests
This commit is contained in:
parent
ed948efabf
commit
8b9c2a3185
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue