Coder Social home page Coder Social logo

geode-logback's Introduction

Geode Logback

This project contains a simple maven pom.xml which excludes the log4j-core dependency from geode-core while also adding logback-classic and log4j-to-slf4j. The JUnit test GeodeApplicationIntegrationTest then demonstrates the creation of a Geode Cache with all Geode logging directed to Logback instead of log4j-core.

As of Apache Geode 1.9.0, all of the code that uses log4j-core is optional such that if you remove log4j-core from your classpath, none of the code requiring it will be used. Since log4j-core is a transitive dependency of geode-core, it will be pulled in automatically unless you explicitly exclude it like this project does.

What is log4j-core?

Log4j-core is a backend similar to Logback, and log4j-api is a frontend similar to slf4j. You can wire up log4j-api to use logback as its backend and you can wire up slf4j to use log4j-core as its backend.

These various combinations do have performance implications and should be thoroughly tested and benchmarked.

Why does Geode use log4j-core

Apache Geode is the open-source inheritor of GemFire which contained its own proprietary logging system including API and backend. That logging system was reimplemented using log4j-core appenders to maintain the existing behavior for backwards compatibility. The following Geode configuration properties are used to configure this logging system:

  • log-disk-space-limit
  • log-file
  • log-file-size-limit
  • log-level

The Geode Alerting system is also implemented using log4j-core appenders because Alerts are generated for log statements that match a specified log level. The default threshold for Alerts is warning.

Excluding log4j-core from the classpath will completely disable the Geode configuration properties for logging, GFSH commands related to altering log level or viewing log files, and the Geode Alerting system.

Geode Statistics

The Geode Statistics archiving system is designed to mimic similar file rolling and disk space usage limiting behavior as Geode Logging, but it is not dependent on log4j-core.

org.apache.geode.internal.logging.ProviderAgent

This project contains a partially stubbed out LogbackAgent class which implements the org.apache.geode.internal.logging.ProviderAgent service loader interface from Apache Geode.

Implementing a class such as LogbackAgent is not necessary to get Geode to log to Logback. However, implementing it would be necessary to fully support the Geode logging configuration properties and GFSH commands related to altering log level or viewing log files.

Note: org.apache.geode.internal.logging.ProviderAgent is currently an internal SPI and may change further before becoming fully supported.

org.apache.geode.internal.alerting.AlertingProvider

To support the Geode Alerting system, the developer would also need to implement the org.apache.geode.internal.alerting.AlertingProvider service loader interface. Without a Logback implementation, Alerting is disabled while using Logback.

Note: org.apache.geode.internal.alerting.AlertingProvider is currently an internal SPI and may change further before becoming fully supported.

Possible future changes to Geode

Moving all geode-core code that uses log4j-core into a new geode-log4j submodule would greatly facilitate setting up a project like this because you could simply include or exclude the geode-log4j dependency.

Similarly, Geode could provide full support for Logback in a new geode-logback submodule.

Completely removing the usage of a logging backend from Apache Geode would remove features that are required for backwards compatibility. This would have to coincide with a major release, such as Geode 2.0.

geode-logback's People

Contributors

kirklund avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.