Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15606

Support Logback and log4j2

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • Observability/Logging
    • None
    • Operability
    • Low Hanging Fruit
    • All
    • None

    Description

      Right now we only support Logback, CCM expects this as well; it is desirable to also support log4j2.

      Right now, if someone wishes to use log4j2 they have to do the following

      1) Compile with Logback
      2) delete logback jars
      3) add log4j2 jars
      4) disable logging in CCM

      This should be simpler and should just be based off the operator (if Logback is better for you, use it, if log4j2 is then use it).

      The main point where we depend on Logback is org.apache.cassandra.utils.logging.LogbackLoggingSupport and this is only enabled if org.apache.cassandra.utils.logging.LoggingSupportFactory sees “logback” in the class name; else everything is disabled (which is why the above steps work). This logic adds some nice integration so this should not be lost and should also be supported in log4j2.

      Lastly, given the implementation of how slf4j picks the binding (ServiceLoader which is classpath order), we should make sure its clear how to properly switch between the two; ideally, if the operator some how selects both, the behavior should be deterministic (slf4j is not))

      Attachments

        Issue Links

          Activity

            People

              savni_nagarkar Savni Nagarkar
              dcapwell David Capwell
              Savni Nagarkar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: