[logback-user] logging arrays?

Jeff Jensen jjensen at apache.org
Mon Nov 2 22:59:56 CET 2009


Not sure about that...  To share the issue, I just created a small test case
that exhibits the behavior; the files are attached.

Just run the test class - you will see an int[] works fine, but a Type[]
obtained from reflection does not.

I'm stumped...
Needs a debug session into logback code which I'm pressed to do ATM.


-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On
Behalf Of Thorbjoern Ravn Andersen
Sent: Monday, November 02, 2009 3:21 PM
To: logback users list
Subject: Re: [logback-user] logging arrays?

Jeff Jensen skrev:
> OK, I feel ridiculous; and I really thought I did this before with
> Logback/slf4j.  Please give me a LMFGTFY, and I will happily take it! ;-)
I
> have googled, reviews the docs, etc.  The problem is, when logging an
array,
> only the first element shows.  Is this WAD - is there a config to get it
to
> do all?  Do I have to loop it myself and log each item?
>   
Might you be hitting into a varargs interpretation?  What happens if you 
add more {}'s to your logging string?

If that is the case you might trick the compiler by putting your array 
in a "new Object[1]".

-- 
  Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"

_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LogArrayTest.java
Type: application/octet-stream
Size: 667 bytes
Desc: not available
URL: <http://qos.ch/pipermail/logback-user/attachments/20091102/c14c3adf/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParameterizedTypeTestChild.java
Type: application/octet-stream
Size: 120 bytes
Desc: not available
URL: <http://qos.ch/pipermail/logback-user/attachments/20091102/c14c3adf/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParameterizedTypeTestClass.java
Type: application/octet-stream
Size: 960 bytes
Desc: not available
URL: <http://qos.ch/pipermail/logback-user/attachments/20091102/c14c3adf/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParameterizedTypeTestInterface.java
Type: application/octet-stream
Size: 77 bytes
Desc: not available
URL: <http://qos.ch/pipermail/logback-user/attachments/20091102/c14c3adf/attachment-0003.obj>


More information about the Logback-user mailing list