You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org> on 2013/03/26 18:29:15 UTC

[jira] [Commented] (KARAF-2234) Thrown Exception in shell commands should be logged as ERROR

    [ https://issues.apache.org/jira/browse/KARAF-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13614331#comment-13614331 ] 

Jean-Baptiste Onofré commented on KARAF-2234:
---------------------------------------------

This "regression" has been introduced by Christian in 1357297, to fix KARAF-1506. I fixed the log level issue.
                
> Thrown Exception in shell commands should be logged as ERROR
> ------------------------------------------------------------
>
>                 Key: KARAF-2234
>                 URL: https://issues.apache.org/jira/browse/KARAF-2234
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-shell
>    Affects Versions: 2.3.1
>         Environment: Karaf
>   Karaf version               2.3.1
>   Karaf home                  /home/rudi/git/bippo-commerce5/karaf_cintalama
>   Karaf base                  /home/rudi/git/bippo-commerce5/karaf_cintalama
>   OSGi Framework              org.apache.felix.framework - 4.0.3
> JVM
>   Java Virtual Machine        OpenJDK 64-Bit Server VM version 23.7-b01
>   Version                     1.7.0_15
>   Vendor                      Oracle Corporation
>   Uptime                      4 minutes
>   Total compile time          21.973 seconds
> Threads
>   Live threads                121
>   Daemon threads              98
>   Peak                        152
>   Total started               201
> Memory
>   Current heap size           118,052 kbytes
>   Maximum heap size           466,048 kbytes
>   Committed heap size         140,544 kbytes
>   Pending objects             0
>   Garbage collector           Name = 'PS Scavenge', Collections = 64, Time = 0.406 seconds
>   Garbage collector           Name = 'PS MarkSweep', Collections = 1, Time = 0.053 seconds
> Classes
>   Current classes loaded      12,803
>   Total classes loaded        12,803
>   Total classes unloaded      0
> Operating system
>   Name                        Linux version 3.5.0-25-generic
>   Architecture                amd64
>   Processors                  8
>            Reporter: Hendy Irawan
>            Assignee: Jean-Baptiste Onofré
>              Labels: regression, shell
>             Fix For: 2.3.2, 2.4.0, 3.0.0
>
>
> 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:
> {code}
> 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]
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira