Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6159

SystemOutRule does not play well with Log4j in tests that verify logging behavior

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: logging, tests
    • Labels:
      None

      Description

      We need to find a better solution that is simpler than having to specify a custom log4j2.xml with LoggerContextRule but works better than SystemOutRule.

      The problem with using SystemOutRule to test output from a logger is that log4j captures System.out into its own static final reference. So tests like this must be run in their own forked JVM.

      See GEODE-6158 for some background about the tests that do specify custom log4j2.xml config files.

        Attachments

          Activity

            People

            • Assignee:
              klund Kirk Lund
              Reporter:
              klund Kirk Lund
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: