geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kirklund <...@git.apache.org>
Subject [GitHub] geode issue #467: GEODE-258: Remove deprecated Cache.getLoggerI18n and getSe...
Date Fri, 05 May 2017 18:25:14 GMT
Github user kirklund commented on the issue:

    https://github.com/apache/geode/pull/467
  
    I think you should the log statements to use Log4j2 loggers instead of changing them to
use a different getLogWriter() API. This work was started in 2014 and was never finished.
    
    To convert a class to use Logger, do the following:
    ```java
    import org.apache.logging.log4j.Logger;
    import org.apache.geode.internal.logging.LogService;
    ...
    private static final Logger logger = LogService.getLogger();
    ```
    And then change blocks like this:
    ```java
    if ((logger != null) && logger.fineEnabled()) {
      logger.fine("RegionSubRegionSnapshot Region entry count =" + this.entryCount + " for
region =" + this.name);
    ```
    
    To this:
    ```java
    if (logger.isDebugEnabled()) {
      logger.debug("RegionSubRegionSnapshot Region entry count ={} for region ={}",  this.entryCount,
this.name);
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message