Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j and large string buffers

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • 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?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • 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 ?
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no its working just fine with ordenry strings
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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?
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as i said its 100 bytes big and its DEBUG level
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • 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
  • 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 ?
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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?
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • 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.
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic