• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

log4j and large string buffers

 
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
im trying to output to log , very large string
but it seams that log4j ignore this string and don't output it (every thing else does output very well )
the string byte count is 100 bytes big .
is there special configuration i need to do for so it will allow me to log bit strings?
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing in the log4j configuration for outputting large strings.
There might be some other problem.

Does the issue go away , when you replace the large string with a smaller one ?
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no its working just fine with ordenry strings
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but it seams that log4j ignore this string and don't output it (every thing else does output very well )



As Rahul said, log4j doesnt do anything special based on the size of the string. What level of log4j are you using to log those messages? And how big is the string?
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as i said its 100 bytes big and its DEBUG level
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one more thing the string im getting is coming from
toString() method of my data struct
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Meir Yan:
one more thing the string im getting is coming from
toString() method of my data struct



What is the datastructure you are talking about ? Is the toString method in that is overridden ?
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, as he speaks it seems to be of overridden toString() method which could probably have been returning the state of the object.

Is that right?
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok the data struct build of List that contains in every element hashtable
its very big when it filled with data , the toString is the List type toString.
 
ben josh
Ranch Hand
Posts: 620
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and that's leads me to the question , how can i output to string

such big data to string?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Meir Yan:
and that's leads me to the question , how can i output to string

such big data to string?



I think you have mistaken something here.

According to your question you are simply sending the list implementation to log and you have not overridden the toString method and values in the list are hashtable.

So I guess , you are getting the default implementation of toString method , which is something like the fully qualified name of the class @ hashcode.
Are you getting something similar to it ?

If you want to change this default behavior of this then try overriding the toString method to output whatever you wish to print in the log?
[ July 12, 2007: Message edited by: Rahul Bhattacharjee ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic