nick-boss-tech opened a new pull request, #5072:
URL: https://github.com/apache/solr/pull/5072

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-5505
   
   ## What happens today
   
   **With `infoStream` on, IndexWriter log lines do not name their core.**
   
   On main, setting `<infoStream>true</infoStream>` creates a 
`LoggingInfoStream` with no core name 
([SolrIndexConfig.java](https://github.com/nick-boss-tech/solr/blob/44c444aa5cd38618424c504fff307ead5cf466cf/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java#L185-L188)).
 Its lines carry only the component and the thread name 
([LoggingInfoStream.java](https://github.com/nick-boss-tech/solr/blob/44c444aa5cd38618424c504fff307ead5cf466cf/solr/core/src/java/org/apache/solr/update/LoggingInfoStream.java#L46)).
   
   ## What this change does
   
   **Each log line gets the core name as a `[core]` segment.**
   
   When the configured stream is a `LoggingInfoStream`, each IndexWriter gets 
its own copy that knows the core name 
([SolrIndexConfig.java](https://github.com/nick-boss-tech/solr/blob/44c444aa5cd38618424c504fff307ead5cf466cf/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java#L261-L265)).
 A line now reads `[core][component][thread]: message` 
([LoggingInfoStream.java](https://github.com/nick-boss-tech/solr/blob/44c444aa5cd38618424c504fff307ead5cf466cf/solr/core/src/java/org/apache/solr/update/LoggingInfoStream.java#L49)).
 Any other `InfoStream` passes through unchanged.
   
   API addition: the public constructor `LoggingInfoStream(String coreName)` 
([LoggingInfoStream.java](https://github.com/nick-boss-tech/solr/blob/44c444aa5cd38618424c504fff307ead5cf466cf/solr/core/src/java/org/apache/solr/update/LoggingInfoStream.java#L38-L40)).
 The no-argument constructor stays.
   
   Behavior change: with infoStream on, every line gains the `[core]` segment. 
Log parsers that match the old format will see the change. No setting keeps the 
old format.
   
   ## Proof
   
   **`TestInfoStreamLogging.testMessagesNameTheCore` checks that a logged line 
names the core.**
   
   The test is 
[TestInfoStreamLogging.java](https://github.com/nick-boss-tech/solr/blob/44c444aa5cd38618424c504fff307ead5cf466cf/solr/core/src/test/org/apache/solr/core/TestInfoStreamLogging.java#L40-L47).
   
   - Pre-fix proof: on base production, TestInfoStreamLogging runs 2 tests with 
exactly 1 failure (testMessagesNameTheCore). The base line has no core name, so 
the `[core][IW]` check is the one that fails.
   - Verified 2026-10-07 at head `44c444aa5cd3`: TestInfoStreamLogging 2/2, 
neighbor TestSolrIndexConfig 2/2. Module check passed.
   
   ## Limits
   
   **Two parts are not covered by a test.**
   
   - The reload path is checked by reading only. Each reload builds a new 
IndexWriterConfig, so the core name follows the core.
   - The new format is not tested against any log parser.
   
   Changelog: `changelog/unreleased/SOLR-5505-infostream-core-name.yml`
   
   ### AI assistance
   
   AI agents assisted with research, implementation, review, and drafting. Nick 
Shanin directed the work and takes responsibility for this contribution.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to