SOLR-7425: Improve MDC based logging format.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1676103 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2015-04-26 13:22:07 +00:00
parent c3185b5489
commit 3862c52b58
2 changed files with 7 additions and 5 deletions

View File

@ -231,6 +231,8 @@ Other Changes
* SOLR-5213: Log when shard splitting unexpectedly leads to documents going to * SOLR-5213: Log when shard splitting unexpectedly leads to documents going to
no or multiple shards (Christine Poerschke, Ramkumar Aiyengar) no or multiple shards (Christine Poerschke, Ramkumar Aiyengar)
* SOLR-7425: Improve MDC based logging format. (Mark Miller)
================== 5.1.0 ================== ================== 5.1.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

View File

@ -365,19 +365,19 @@ public class SolrLogLayout extends Layout {
private void appendMDC(StringBuilder sb) { private void appendMDC(StringBuilder sb) {
if (!StringUtils.isEmpty(MDC.get(NODE_NAME_PROP))) { if (!StringUtils.isEmpty(MDC.get(NODE_NAME_PROP))) {
sb.append(" N:").append(MDC.get(NODE_NAME_PROP)); sb.append(" n:").append(MDC.get(NODE_NAME_PROP));
} }
if (!StringUtils.isEmpty(MDC.get(COLLECTION_PROP))) { if (!StringUtils.isEmpty(MDC.get(COLLECTION_PROP))) {
sb.append(" C:").append(MDC.get(COLLECTION_PROP)); sb.append(" c:").append(MDC.get(COLLECTION_PROP));
} }
if (!StringUtils.isEmpty(MDC.get(SHARD_ID_PROP))) { if (!StringUtils.isEmpty(MDC.get(SHARD_ID_PROP))) {
sb.append(" S:").append(MDC.get(SHARD_ID_PROP)); sb.append(" s:").append(MDC.get(SHARD_ID_PROP));
} }
if (!StringUtils.isEmpty(MDC.get(REPLICA_PROP))) { if (!StringUtils.isEmpty(MDC.get(REPLICA_PROP))) {
sb.append(" R:").append(MDC.get(REPLICA_PROP)); sb.append(" r:").append(MDC.get(REPLICA_PROP));
} }
if (!StringUtils.isEmpty(MDC.get(CORE_NAME_PROP))) { if (!StringUtils.isEmpty(MDC.get(CORE_NAME_PROP))) {
sb.append(" c:").append(MDC.get(CORE_NAME_PROP)); sb.append(" x:").append(MDC.get(CORE_NAME_PROP));
} }
} }
} }