• Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 7.2.0.CD13
    • 7.0.0.GA
    • CLI
    • None

      We should improve a logging capabilities of CLI. CLI logging is disabled by default, but it can be enabled by altering the jboss-cli-logging.properties.

      Here is my test scenario.

      [pkremens@localhost bin]$ ./jboss-cli.sh -c
      [standalone@localhost:9990 /] /system-property=foo:add(value=bar bar)
      {"outcome" => "success"}
      [standalone@localhost:9990 /] shutdown 
      

      Set CLI logger level to ALL (logger.org.jboss.as.cli.level=ALL) to see all logs produced by CLI

      actual content of jboss-cli.log - only server response is logged

      13:45:48,041 DEBUG [org.jboss.as.cli.CommandContext] connecting to localhost:9990 as null
      13:46:04,033 INFO  [org.jboss.as.cli.CommandContext] {"outcome" => "success"}
      

      I can imagine content like following could be helpful for troubleshooting

      ...
      <TIME> <LEVEL>  [org.jboss.as.cli.CommandContext] /system-property=foo:add(value=bar bar)
      {
          "address" => [("system-property" => "foo")],
          "operation" => "add",
          "value" => "barbar"
      }
      <TIME> <LEVEL>  [org.jboss.as.cli.CommandContext] {"outcome" => "success"}
      

      AFAICT the only possibility to get the actual CLI requests in raw form is to map the content of $HOME/.jboss-cli-history file with configuration history or audit log now.

            [JBEAP-4904] Enhance a CLI logging

            Verified with 7.2.0.CD13.

            Erich Duda (Inactive) added a comment - Verified with 7.2.0.CD13.

            jdenise@redhat.com Hmm I really had wrong config. It works for me with your property file. Setting as verified. Thank you.

            Erich Duda (Inactive) added a comment - jdenise@redhat.com Hmm I really had wrong config. It works for me with your property file. Setting as verified. Thank you.

            eduda_jira, I attached the properties file I am using and I can see the command as well as the result.

            Jean Francois Denise added a comment - eduda_jira , I attached the properties file I am using and I can see the command as well as the result.

            jdenise@redhat.com When I tried it on 6th August, I didn't see commands in the log. I saw just results of the commands. I set handler.FILE.level=ALL.

            Erich Duda (Inactive) added a comment - jdenise@redhat.com When I tried it on 6th August, I didn't see commands in the log. I saw just results of the commands. I set handler.FILE.level=ALL.

            eduda_jira, mstefank, when enabling the CLI logger you also need to set the handler.FILE.level=ALL
            In this case you will see a lot more output and the commands are logged. I don't think that we need any special logging API.

            Jean Francois Denise added a comment - eduda_jira , mstefank , when enabling the CLI logger you also need to set the handler.FILE.level=ALL In this case you will see a lot more output and the commands are logged. I don't think that we need any special logging API.

            Reopening. I followed the steps from description and the log contains only an outcome of command but the command itself is not logged. I tried it with WF 12, WF 13 and WF master.

            Erich Duda (Inactive) added a comment - Reopening. I followed the steps from description and the log contains only an outcome of command but the command itself is not logged. I tried it with WF 12, WF 13 and WF master.

            Marek Kopecky added a comment - mnovak1@redhat.com ^^^

            Kabir Khan added a comment -

            pkremens@redhat.com Moving to QA for CD12

            Kabir Khan added a comment - pkremens@redhat.com Moving to QA for CD12

            Fix is merged upstream.

            Brian Stansberry added a comment - Fix is merged upstream.

            Deferring it, once CLI is switched to use aesh-readline (target 7.2), I will update the CLI logging.

            Jean Francois Denise added a comment - Deferring it, once CLI is switched to use aesh-readline (target 7.2), I will update the CLI logging.

              mstefank Martin Stefanko
              pkremens@redhat.com Petr Kremensky (Inactive)
              Erich Duda Erich Duda (Inactive)
              Erich Duda Erich Duda (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: