Pivotal Knowledge Base


Gemfire Log File not Rolling at log-file-size-limit


Pivotal GemFire 7.x-8.x


This article describes how to resolve a situation where the GemFire log file is not rolling at the log-file-size-limit.

The size of the GemFire log file may grow (potentially, much) larger than the "log-file-size-limit" as its set in gemfire.properties.


GemFire tracks log file size by tracking the size of log messages as they are logged. Hence, the mechanism by which GemFire checks log file size against the "log-file-size-limit" will not include logging which is captured from stdout or stderr rather than going through the usual logging API. In other words, logging to stdout or stderr that is redirected into the GemFire log bypasses the usual file size monitoring, so will not be considered in the size of the log file for the purpose of log rolling.

For example, if you use System.out.println() to output logs into the GemFire log from a cacheListener, those logs will not be counted in the log-file-size-limit check.


In order to resolve this, there are two possible options:

  1. Use GemFire's internal logger API to pipe application logging into the GemFire log file.


    GemFireCacheImpl.getInstance().getLogger().info("application log");
  2. Use log4J/log4J2 to pipe application logging into a separate application log rather than the GemFire log file.

    For example(log4J):

    log4j.rootLogger=info, R
    log4j.appender.R.layout.ConversionPattern=[%-5p] %d [%c{1}] [%t]- %m%n


Additional Information

For further information, please refer to the following resources:

  • For the GemFire internal logger API usage, you can refer the example under [Gemfire_Installation_Home]/SampleCode/examples/dist/cacheRunner/LoggingCacheCallback.java
  • Starting with GemFire 8.1+, GemFire uses Log4J2 for logging and no longer pipes stdout/stderr to a file. Applications should use a logging API such as Log4J2.



Powered by Zendesk