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

Add ability to set/get logging levels to nodetool

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.0.8, 2.1 beta2
    • Tool/nodetool
    • None

    Description

      While it is nice to use logback (per #CASSANDRA-5883) and with the autoreload feature, in some cases ops/admin may not have the permission or ability to modify the configuration file(s). Or the files are controlled by puppet/chef so it is not desirable to modify them manually.

      There is already an existing operation for setLoggingLevel in the StorageServuceMBean , so that's easy to expose that to the nodetool

      But what was lacking was ability to see the current log level settings for various loggers.

      The attached diff aims to do 3 things:

      1. add JMX getLoggingLevels --> return a map of current loggers and the corresponding levels
      2. expose both getLoggingLevels and setLoggingLevel to nodetool. In particular, the setLoggingLevel behave as follows:
        • If both classQualifer and level are empty/null, it will reload the configuration to reset.
        • If classQualifer is not empty but level is empty/null, it will set the level to null for the defined classQualifer
        • The logback configuration should have < jmxConfigurator /> set

      The diff is based on the master branch which uses logback, soit is not applicable to 2.0 or 1.2. (2.1 is ok) Though it would be nice to have the same ability for 2.0.

      Attachments

        1. 0001-CASSANDRA-7090.patch
          10 kB
          Vijay
        2. patch-7090.v20
          9 kB
          Jackson Chung
        3. logging.diff
          22 kB
          Jackson Chung

        Activity

          People

            cywjackson Jackson Chung
            cywjackson Jackson Chung
            Jackson Chung
            Vijay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: