Class LogbackLoggingSupport

java.lang.Object
org.apache.cassandra.utils.logging.LogbackLoggingSupport
All Implemented Interfaces:
LoggingSupport

public class LogbackLoggingSupport extends Object implements LoggingSupport
Encapsulates all logback-specific implementations in a central place. Generally, the Cassandra code-base should be logging-backend agnostic and only use slf4j-api. This class MUST NOT be used directly, but only via LoggingSupportFactory which dynamically loads and instantiates an appropriate implementation according to the used slf4j binding.
  • Constructor Details

    • LogbackLoggingSupport

      public LogbackLoggingSupport()
  • Method Details

    • onStartup

      public void onStartup()
      Description copied from interface: LoggingSupport
      Hook used to execute logging implementation specific customization at Cassandra startup time.
      Specified by:
      onStartup in interface LoggingSupport
    • onShutdown

      public void onShutdown()
      Description copied from interface: LoggingSupport
      Hook used to execute logging implementation specific customization at Cassandra shutdown time.
      Specified by:
      onShutdown in interface LoggingSupport
    • setLoggingLevel

      public void setLoggingLevel(String classQualifier, String rawLevel) throws Exception
      Description copied from interface: LoggingSupport
      Changes the given logger to the given log level.
      Specified by:
      setLoggingLevel in interface LoggingSupport
      Parameters:
      classQualifier - the class qualifier or logger name
      rawLevel - the string representation of a log level
      Throws:
      Exception - an exception which may occur while changing the given logger to the given log level.
    • getLoggingLevels

      public Map<String,String> getLoggingLevels()
      Specified by:
      getLoggingLevels in interface LoggingSupport
      Returns:
      a map of logger names and their associated log level as string representations.
    • getAppender

      public Optional<ch.qos.logback.core.Appender<?>> getAppender(Class<?> appenderClass, String name)
      Specified by:
      getAppender in interface LoggingSupport