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

Thrown Exception in shell commands should be logged as ERROR

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.1
    • 2.3.2, 2.4.0, 3.0.0
    • karaf

    Description

      If I remember correctly, the behavior in 2.3.0 was logging exceptions as ERROR. But for some reason, in 2.3.1 it is INFO. This makes it much harder to see/filter it in a flood of log messages.

      Example log:

      2013-03-12 17:29:49,784 | INFO  | l Console Thread | Console                          | araf.shell.console.jline.Console  198 | 14 - org.apache.karaf.shell.console - 2.3.1 | Exception caught while executing command
      java.lang.NullPointerException
              at id.co.bippo.salesorder.shell.hand.SalesOrderAddCommand.updateStockInventory(SalesOrderAddCommand.java:172)[302:id.co.bippo.salesorder.shell:5.0.0.SNAPSHOT]
              at id.co.bippo.salesorder.shell.hand.SalesOrderAddCommand.doExecute(SalesOrderAddCommand.java:152)[302:id.co.bippo.salesorder.shell:5.0.0.SNAPSHOT]
              at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[14:org.apache.karaf.shell.console:2.3.1]
              at org.soluvas.commons.shell.TenantCommandSupport.execute(TenantCommandSupport.java:55)[272:org.soluvas.commons:2.0.0.SNAPSHOT]
              at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.1]
              at org.apache.karaf.shell.console.jline.Console.run(Console.java:174)[14:org.apache.karaf.shell.console:2.3.1]
              at java.lang.Thread.run(Thread.java:722)[:1.7.0_15]
      

      BTW I use Lilith during development, and it has a nice feature of showing error logs in big red color, so it's very easy to spot.

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            ceefour Hendy Irawan
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: