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

Jason Gerlowski commented on SOLR-8330:
---------------------------------------

I'm going to take an initial crack at this.  Though I can't think of any 
reasonable rationale for re-using loggers between classes, there might be a use 
case I'm not aware of.  So where there's any doubt, I'll be leaving those 
declarations as-is.  (This can always be changed later if there's a stronger 
consensus on being stricter about this.)

For the logger declarations that I do change, I plan on using the copy-paste 
safe declaration suggested by Uwe on SOLR-8324:

{code:java}
    import java.lang.invoke.MethodHandles;
    //...
    private static final Logger log = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
{code}

> 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
>              Labels: logging
>             Fix For: Trunk
>
>
> 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