Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4833

All(most all) Logger instances should be made static

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hossman Hoss Man
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: