Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This section lists the Bugs and Feature Requests that also need to be addressed as part of this overall effort:

    • 2.1 #47722 1 #47722 G0 Configurable option of appending to log file or creating new file
    • 2.2 #50483 2 #50483 F0 log file size does not account for user/application logging
    • 2.3 #51111 3 #51111 F0 Web application (Tomcat) logging goes to gemfire log
    • 2.4 #47910 4 #47910 R2 <Regression> ConcurrentModificationException in createLogWriter during locator startup.
    • 2.5 #51207 5 #51207 F2 Improve logging configuration for libraries
    • 2.6 #40414 6 #40414 R3 i18n changes (toLocalizedString) causes ports, ids to be formatted with commas
    • 2.7 #43396 7 #43396 R3 Remove dead messages from LocalizedStrings and fix any obvious typos
    • 2.8 #51197 8 #51197 C2 A log file name with no '.log' extension causes the gfxd connect to fail after the first time
    • 2.9 #45796 9 #45796 F3 Feature Request:Adding a Functionality to Make Logging Custom Filter Available in Gemfire

Introducing Log4J 2 as our underlying logging library satisfies 2.1. #47722 and 2.5. #51207. In addition it makes 2.4. #47910 go away.

...

TODO: verify that Log4J 2 fulfills all of #48796 as well. Log4J 2 certainly provides robust filtering but does it support java.util.logging.Filters also?

3 Related Documents

  • Logging Thoughts
  • Logging Backlog (do we have a better tool than a spreadsheet?)

4 Terminology

  • FQCN -- Fully-qualified class name which is used as the name of the logger that is declared at the top of the class or the class’s root ancestor. Example:

...

Log4J 2 is a complete overhaul of Log4J incorporating the best changes introduced by SLF4J. It separates the library into two primary jars: log4j2-api and log4j2-core. Log4J 2 provides a much more versatile library than SLF4J and is much more customizable. Our selection is driven by the need to customize logging and its reported performance characteristics. We are not advocating async loggers which are present in some form in both Log4J 2 and LogBack. Log4J 2 improves performance dramatically over Log4J 1.x as well as SLF4J. For reasons of customization we had to select Log4J 2 and its performance helped solidify that decision.

Note that Log4J2 was chosen for the logging backend instead of LogBack because Log4J2 processes disabled DEBUG statements faster at INFO level than LogBack does. When comparing logging throughput at DEBUG level, LogBack was slightly faster, but when comparing overall impact to application performance Log4J2 was faster. In other words, GemFire using Log4J2 out-performed GemFire using LogBack at INFO level or above. Since INFO level or above is expected for production systems, Log4J2 was chosen over SLF4J and LogBack. GemFire code base will use Log4J2 API while the custom logging appenders for LogWriter-style rolling and Alerts will use Log4J2 Core.

For more information, please see The Logging Olympics – A Race Between Today’s Top 5 Java Logging Frameworks

...

6.3 Log statements should be updated to use Log4J 2’s parameterization:

...

Code Block
languagejava
if (log.isDebugEnabled()) {   
  log.debug("Hi, " + string1 + " " + string2);
}

...

6.6 By default the new Log4J 2 logging will be enabled for logging to stdout. The standard way of configuring Log4J 2 is with a log4j2.xml and we won’t change that. GemFire will include a copy of its default log4j2.xml configuration of Log4J 2 in GEMFIRE/defaultConfigs with a PatternLayout that makes the log message format the same as what LogWriter produces. The com.gemstone.gemfire.internal.logging.log4j package will include a copy of that same log4j2.xml as a resource to use if no other configuration is available. If user has already configured Log4J 2 then the user’s configuration will be used. If it has not been configured then the search order of precedence will be a) specified by user with the standard Log4J 2 system property, b) current working directory of the GemFire process, c) GEMFIRE/defaultConfigs (KIRK: delete this from search path but leave it there as an example), d) com.gemstone.gemfire.logging.internal.log4j.log4j2-default.xml resource inside the gemfire.jar.

...

TODO: Proposed Markers (we should refine this list and add any that are missing): 

 

      • DLS or DISTRIBUTED_LOCK_SERVICE
      • PERSISTENCE
      • MEMBERSHIP or GMS
      • CLIENT
      • SERVER
      • REGION

...

7.10.1 Removal of OSProcess.redirectCOutput. We will remove the default use of this. The LogWriterAppender will not have stdout and stderr redirected to. Should we retain this and only enable it based on an undocumented system property? (Kirk: probably not) This is primarily to satisfy:

    • #51111 F0 Web application (Tomcat) logging goes to gemfire log
    • #50483 F0 log file size does not account for user/application logging

8 Feature Interactions

8.1 GFSH

...