lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1670523 - in /lucene/dev/trunk: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/core/ solr/core/src/java/org/apache/solr/handler/admin/ solr/core/src/java/org/apache/solr/logging/log4j/ solr/webapp/ solr/webapp/web/js/scripts/
Date Wed, 01 Apr 2015 00:24:35 GMT
Author: ryan
Date: Wed Apr  1 00:24:35 2015
New Revision: 1670523

URL: http://svn.apache.org/r1670523
Log:
Merged revision(s) 1670522 from lucene/dev/branches/branch_5x:
SOLR-7329: show core in logging UI
........

Modified:
    lucene/dev/trunk/   (props changed)
    lucene/dev/trunk/solr/   (props changed)
    lucene/dev/trunk/solr/core/   (props changed)
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LoggingHandler.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java
    lucene/dev/trunk/solr/webapp/   (props changed)
    lucene/dev/trunk/solr/webapp/web/js/scripts/logging.js

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1670523&r1=1670522&r2=1670523&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java Wed Apr  1 00:24:35
2015
@@ -90,6 +90,7 @@ import org.apache.solr.handler.RequestHa
 import org.apache.solr.handler.admin.ShowFileRequestHandler;
 import org.apache.solr.handler.component.HighlightComponent;
 import org.apache.solr.handler.component.SearchComponent;
+import org.apache.solr.logging.MDCUtils;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.SolrRequestHandler;
 import org.apache.solr.response.BinaryResponseWriter;
@@ -691,6 +692,8 @@ public final class SolrCore implements S
   public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema schema, CoreDescriptor
cd, UpdateHandler updateHandler, IndexDeletionPolicyWrapper delPolicy, SolrCore prev) {
     coreDescriptor = cd;
     this.setName( name );
+    MDCUtils.setCore(name); // show the core name in the error logs
+    
     resourceLoader = config.getResourceLoader();
     this.solrConfig = config;
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LoggingHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LoggingHandler.java?rev=1670523&r1=1670522&r2=1670523&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LoggingHandler.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LoggingHandler.java
Wed Apr  1 00:24:35 2015
@@ -121,7 +121,7 @@ public class LoggingHandler extends Requ
         SimpleOrderedMap<Object> info = new SimpleOrderedMap<>();
         if(time>0) {
           info.add("since", time);
-          info.add("found", found);
+          info.add("found", found.get());
         }
         else {
           info.add("levels", watcher.getAllLevels()); // show for the first request

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java?rev=1670523&r1=1670522&r2=1670523&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java Wed
Apr  1 00:24:35 2015
@@ -16,26 +16,27 @@
  */
 package org.apache.solr.logging.log4j;
 
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
-import com.google.common.base.Throwables;
 import org.apache.log4j.AppenderSkeleton;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.log4j.spi.LoggingEvent;
 import org.apache.log4j.spi.ThrowableInformation;
 import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.logging.CircularList;
 import org.apache.solr.logging.ListenerConfig;
 import org.apache.solr.logging.LogWatcher;
 import org.apache.solr.logging.LoggerInfo;
 
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.google.common.base.Throwables;
 
 public class Log4jWatcher extends LogWatcher<LoggingEvent> {
 
@@ -157,6 +158,12 @@ public class Log4jWatcher extends LogWat
     if(t!=null) {
       doc.setField("trace", Throwables.getStackTraceAsString(t.getThrowable()));
     }
+    
+    // Will be null if not present
+    doc.setField("core", event.getMDC(ZkStateReader.CORE_NAME_PROP));
+    doc.setField("collection", event.getMDC(ZkStateReader.COLLECTION_PROP));
+    doc.setField("replica", event.getMDC(ZkStateReader.REPLICA_PROP));
+    doc.setField("shard", event.getMDC(ZkStateReader.SHARD_ID_PROP));
     return doc;
   }
 }
\ No newline at end of file

Modified: lucene/dev/trunk/solr/webapp/web/js/scripts/logging.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/logging.js?rev=1670523&r1=1670522&r2=1670523&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/scripts/logging.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/scripts/logging.js Wed Apr  1 00:24:35 2015
@@ -361,6 +361,7 @@ var load_logging_viewer = function()
           content += '<tr class="' + classes.join( ' ' ) + '">' + "\n";
             content += '<td class="span"><a><span>' + format_time( doc.time
) + '</span></a></td>' + "\n";
             content += '<td class="level span"><a><span>' + doc.level.esc()
+ '</span></span></a></td>' + "\n";
+            content += '<td class="span"><a><span>' + doc.core   + '</span></a></td>'
+ "\n";
             content += '<td class="span"><a><span>' + doc.logger + '</span></a></td>'
+ "\n";
             content += '<td class="message span"><a><span>' + doc.message.replace(
/,/g, ',&#8203;' ).esc() + '</span></a></td>' + "\n";
           content += '</tr>' + "\n";
@@ -433,6 +434,7 @@ sammy.get
                   '<tr>' + "\n" +
                     '<th class="time">Time (<span>Local</span>)</th>'
+ "\n" +
                     '<th class="level">Level</th>' + "\n" +
+                    '<th class="core">Core</th>' + "\n" +
                     '<th class="logger">Logger</th>' + "\n" +
                     '<th class="message">Message</th>' + "\n" +
                   '</tr>' + "\n" +



Mime
View raw message