I’m using the SLF4J Reporter for logging metrics 
(https://lucene.apache.org/solr/guide/7_5/metrics-reporting.html#slf4j-reporter).
 I have two collections with 5 shards each. Only 3 shards of one collection are 
printing collection, shard, replica, and core data in the log statements, the 
others do not. For the same metric log statement this data is only present for 
3 of the 10 shards.

The three shards will have something like: 2019-01-25 21:41:05.297 INFO 
(metrics-org.apache.solr.metrics.reporters.SolrSlf4jReporter-6-thread-1) 
[c:coll_1 s:shard2 r:core_node13 x:coll_1_shard2_replica_n10] type=GAUGE, 
name=SEARCHER.searcher.numDocs, value=236140

Others will have: 2019-01-25 21:41:07.125 INFO 
(metrics-org.apache.solr.metrics.reporters.SolrSlf4jReporter-8-thread-1) [ ] 
type=GAUGE, name=SEARCHER.searcher.numDocs, value=899794



Here is the config for my metrics log in log4j2.xml:
<RollingFile
    name="MetricsFile"
    fileName="<%= @solr_logs %>/solr_metrics.log"
    filePattern="<%= @solr_logs %>/solr_metrics.log.%i" >
  <PatternLayout>
    <Pattern>
      %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} 
%X{replica} %X{core}] %c{1.} %m%n
    </Pattern>
  </PatternLayout>
  <Policies>
    <OnStartupTriggeringPolicy />
    <SizeBasedTriggeringPolicy size="32 MB"/>
  </Policies>
  <DefaultRolloverStrategy max="10"/>
</RollingFile>

Any thoughts on how to get the collection, shard, replica, and core data 
printed in every log statement?

Thanks for the help!
Alicia

Reply via email to