Karaf
  1. Karaf
  2. KARAF-1013

Less verbose in log when mistyped commands at INFO level

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.5, 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      If you mistype a command, then you get a verbose stracktrace in the logs at INFO level

      13:22:22,785 | INFO  | l Console Thread | Console                          | 37 - org.apache.karaf.shell.console - 2.2.2.fuse-02-06 | Exception caught while executing command
      org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: osgi:header
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at org.apache.karaf.shell.console.jline.Console.run(Console.java:240)[37:org.apache.karaf.shell.console:2.2.2.fuse-02-06]
      	at java.lang.Thread.run(Thread.java:680)[:1.6.0_26]
      

      I would prefer if this was less verbose by default. And that strack traces is only included at DEBUG level etc.

      This is the case for CommandNotFoundException, and possible other exceptions where we don't need the stacktrace to make the logs verbose.

      Also if people check the logs, then they spot stacktraces, and may think that its serious problems. Which this of course is not.
      Maybe only log this at DEBUG level all together. As the end users gets reported on the shell about the unknown command.

      1. karaf1013.patch
        1.0 kB
        Glen Mazza

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development