Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2300

log command to list all the logging levels currently been set

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.3, 2.4.0, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None

      Description

      You can use log:set to set a logging level for a logger name.

      eg

      log:set DEBUG org.apache.camel
      

      But you cannot see what has been configured, eg
      log:get

      Will only show for the root logger, which typically is INFO.

      What we need is

      log:list
      

      To show all the custom logging levels been set.
      Something alike:

      log:list
      Level            Name
      INFO             ROOT
      DEBUG            org.apache.camel
      

      Also the MBean for the log should expose a JMX operation to get this data.
      org.apache.karaf.management.mbeans.log.internal.LogMBeanImpl

        Activity

        Hide
        davsclaus Claus Ibsen added a comment -

        If you remember the logger name, you can type

        log:get org.apache.camel
        

        But what is needed is that list command to set which has been explicit set.

        There is also log:clear to clear all the entires.

        Show
        davsclaus Claus Ibsen added a comment - If you remember the logger name, you can type log:get org.apache.camel But what is needed is that list command to set which has been explicit set. There is also log:clear to clear all the entires.
        Hide
        alanfoster Alan Foster added a comment -

        Hi Claus,

        I was just checking out the source code to see if this would require much work to do;

        I noticed that there's support for supplying ALL as an argument

        karaf@root> log:set DEBUG org.apache.camel
        karaf@root> log:get ALL
        ROOT: INFO
        org.apache.camel: DEBUG
        

        Does that offer the functionality you were after?

        Show
        alanfoster Alan Foster added a comment - Hi Claus, I was just checking out the source code to see if this would require much work to do; I noticed that there's support for supplying ALL as an argument karaf@root> log:set DEBUG org.apache.camel karaf@root> log:get ALL ROOT: INFO org.apache.camel: DEBUG Does that offer the functionality you were after?
        Hide
        davsclaus Claus Ibsen added a comment -

        Yeah the ALL is what I need. Though it should be mentioned in the help for the log:get so people is aware of this. AFAIR it only mentions about ROOT.

        Also the JMX MBean operation is still needed so tooling and others can get this information as well.

        Show
        davsclaus Claus Ibsen added a comment - Yeah the ALL is what I need. Though it should be mentioned in the help for the log:get so people is aware of this. AFAIR it only mentions about ROOT. Also the JMX MBean operation is still needed so tooling and others can get this information as well.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        I update the doc with that.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - I update the doc with that.
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        Added log:list alias and update documentation on trunk: http://svn.apache.org/viewvc?view=revision&revision=1523452

        Show
        jbonofre Jean-Baptiste Onofré added a comment - Added log:list alias and update documentation on trunk: http://svn.apache.org/viewvc?view=revision&revision=1523452
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        Added log:list alias and update documentation on karaf-2.x: http://svn.apache.org/viewvc?view=revision&revision=1523453

        Show
        jbonofre Jean-Baptiste Onofré added a comment - Added log:list alias and update documentation on karaf-2.x: http://svn.apache.org/viewvc?view=revision&revision=1523453
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        Added log:list alias and update documentation on karaf-2.3.x: http://svn.apache.org/viewvc?view=revision&revision=1523455

        Show
        jbonofre Jean-Baptiste Onofré added a comment - Added log:list alias and update documentation on karaf-2.3.x: http://svn.apache.org/viewvc?view=revision&revision=1523455

          People

          • Assignee:
            jbonofre Jean-Baptiste Onofré
            Reporter:
            davsclaus Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development