[ 
https://issues.apache.org/jira/browse/SOLR-5277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13782497#comment-13782497
 ] 

Robert Muir commented on SOLR-5277:
-----------------------------------

I searched with eclipse for "commitScheduler" and found it here.

So here is an untested example of what i mean:

{noformat}
Index: solr/core/src/java/org/apache/solr/update/CommitTracker.java
===================================================================
--- solr/core/src/java/org/apache/solr/update/CommitTracker.java        
(revision 1527836)
+++ solr/core/src/java/org/apache/solr/update/CommitTracker.java        
(working copy)
@@ -53,8 +53,7 @@
   private int docsUpperBound;
   private long timeUpperBound;
   
-  private final ScheduledExecutorService scheduler = 
-      Executors.newScheduledThreadPool(1, new 
DefaultSolrThreadFactory("commitScheduler"));
+  private final ScheduledExecutorService scheduler;
   private ScheduledFuture pending;
   
   // state
@@ -72,6 +71,7 @@
   public CommitTracker(String name, SolrCore core, int docsUpperBound, int 
timeUpperBound, boolean openSearcher, boolean softCommit) {
     this.core = core;
     this.name = name;
+    scheduler = Executors.newScheduledThreadPool(1, new 
DefaultSolrThreadFactory("commitScheduler-" + core.getName()));
     pending = null;
     
     this.docsUpperBound = docsUpperBound;
{noformat}

> Stamp core names on log entries for certain classes
> ---------------------------------------------------
>
>                 Key: SOLR-5277
>                 URL: https://issues.apache.org/jira/browse/SOLR-5277
>             Project: Solr
>          Issue Type: Bug
>          Components: search, update
>    Affects Versions: 4.3.1, 4.4, 4.5
>            Reporter: Dmitry Kan
>         Attachments: SOLR-5277.patch
>
>
> It is handy that certain Java classes stamp a [coreName] on a log entry. It 
> would be useful for multicore setup if more classes would stamp this 
> information.
> In particular we came accross a situaion with commits coming in a quick 
> succession to the same multicore shard and found it to be hard time figuring 
> out was it the same core or different cores.
> The classes in question with log sample output:
> o.a.s.c.SolrCore
> 06:57:53.577 [qtp1640764503-13617] INFO  org.apache.solr.core.SolrCore - 
> SolrDeletionPolicy.onCommit: commits:num=2
> 11:53:19.056 [coreLoadExecutor-3-thread-1] INFO  
> org.apache.solr.core.SolrCore - Soft AutoCommit: if uncommited for 1000ms;
> o.a.s.u.UpdateHandler
> 14:45:24.447 [commitScheduler-9-thread-1] INFO  
> org.apache.solr.update.UpdateHandler - start 
> commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=true,prepareCommit=false}
> 06:57:53.591 [qtp1640764503-13617] INFO  org.apache.solr.update.UpdateHandler 
> - end_commit_flush
> o.a.s.s.SolrIndexSearcher
> 14:45:24.553 [commitScheduler-7-thread-1] INFO  
> org.apache.solr.search.SolrIndexSearcher - Opening Searcher@1067e5a9 main
> The original question was posted on #solr and on SO:
> http://stackoverflow.com/questions/19026577/how-to-output-solr-core-name-with-log4j



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to