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

Anshum Gupta commented on SOLR-8330:
------------------------------------

Hmm the patch applied cleanly but there were compilation errors which I 
discovered when I tried to run the tests. Most of those were because:
* Extended classes e.g. HdfsUpdateLog, CdcrTransactionLog was trying to reuse 
the logger from the parent class, which no longer is possible as the loggers 
are all private. I've added new loggers for that purpose.
* SolrCore.log was being used at multiple places e.g. in RequestHandlerBase. 
Unless there's something I'm completely missing here, it doesn't make sense to 
do that in line what [~mdrob] mentioned about debugging through logs. I've 
changed that to use the file specific logger instead (even for abstract 
classes).
* PreAnalyzedUpdateProcessorFactory is where it's more interesting. There are 2 
classes in there public PreAnalyzedUpdateProcessorFactory, and 
PreAnalyzedUpdateProcessor. The logger is required in 
PreAnalyzedUpdateProcessor but the file is named 
PreAnalyzedUpdateProcessorFactory which would mean that this issue still 
remains in this case here. We should just move this to another file, but I'll 
use another JIRA for that and not mix the 2 up.

I'm almost done with fixing the compilation issues but will take some more time 
tonight before committing this. If there are any red flags that someone notices 
here, please raise your hand. :)

> Remove unintentionally shared loggers.
> --------------------------------------
>
>                 Key: SOLR-8330
>                 URL: https://issues.apache.org/jira/browse/SOLR-8330
>             Project: Solr
>          Issue Type: Sub-task
>    Affects Versions: Trunk
>            Reporter: Jason Gerlowski
>            Assignee: Anshum Gupta
>              Labels: logging
>             Fix For: Trunk
>
>         Attachments: SOLR-8330.patch, SOLR-8330.patch, SOLR-8330.patch
>
>
> As Mike Drob pointed out in Solr-8324, many loggers in Solr are 
> unintentionally shared between classes.  Many instances of this are caused by 
> overzealous copy-paste.  This can make debugging tougher, as messages appear 
> to come from an incorrect location.
> As discussed in the comments on SOLR-8324, there also might be legitimate 
> reasons for sharing loggers between classes.  Where any ambiguity exists, 
> these instances shouldn't be touched.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to