You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Greg Bowyer (JIRA)" <ji...@apache.org> on 2013/05/23 04:12:20 UTC

[jira] [Updated] (SOLR-4833) All(most all) Logger instances should be made static

     [ https://issues.apache.org/jira/browse/SOLR-4833?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Bowyer updated SOLR-4833:
------------------------------

    Attachment: SOLR-4833-Remove-None-static-loggers.patch

I took a first stab at this, two things strike me.

* Should lucene use SLF4J as a logging framework instead of j.u.logging ?

* Should loggers that are defined on parent classes be removed, I feel that *if* we want subclasses to go through the same logger, they can all access that logger by its moniker themselves, the only thing that stopped me in my tracks is that some of the exposed loggers form part of the user extensible API surface. 
                
> All(most all) Logger instances should be made static
> ----------------------------------------------------
>
>                 Key: SOLR-4833
>                 URL: https://issues.apache.org/jira/browse/SOLR-4833
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>         Attachments: SOLR-4833-Remove-None-static-loggers.patch
>
>
> The majority of Logger usage in Solr is via static variables, but there are a few places where this pattern does not hold true - i think we should fix that and be completley consistent.  if there is any specific cases where a non-static variable really makes a lot of sense, then it should be heavily commented as to why.
> ----
> The SLF4J FAQ has a list of pros and cons for why Logger variables should/shouldn't be static...
> http://slf4j.org/faq.html#declared_static
> ...the majority of the "pros" for non-static usage don't really apply to Solr, while the pros for static usage due.
> Another lucene/solr specific pro in favor of static variables for loggers is the way our test framework looks for memory leaks in tests.  Having a simple test that does not null out a static reference to what seems like a small object is typically fine -- but if that small object has an explicit (non-static) reference to a Logger, all of the state in that Logger is counted as part of the size of that small object leading to confusion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org