Hi Alicia,

You've probably already tried this but just to check all the basics, verify
that each log4j2.xml file is the same on all of your servers. Then go to
the logging config admin page on each machine and verify that none of the
overrides have been enabled. The overrides there are temporary, so you can
either reset them if they've been changed or restart the instance to get
back to default.

If none of that helps let us know how many nodes you're running, and
double-check the file permissions on log4j2.xml. You could also make a
slight modification to the format string just to verify that it's indeed
being read.

Hope that helps!
Scott

On Fri, Jan 25, 2019 at 6:35 PM Alicia Broederdorf <abroederd...@axon.com>
wrote:

> 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
>


-- 
Scott Stults | Founder & Solutions Architect | OpenSource Connections, LLC
| 434.409.2780
http://www.opensourceconnections.com

Reply via email to