File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes log4j and large string buffers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j and large string buffers " Watch "log4j and large string buffers " New topic
Author

log4j and large string buffers

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
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

Joined: Nov 29, 2005
Posts: 2308
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 ?


Rahul Bhattacharjee
LinkedIn - Blog
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
no its working just fine with ordenry strings
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159

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?


[My Blog] [JavaRanch Journal]
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
as i said its 100 bytes big and its DEBUG level
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
one more thing the string im getting is coming from
toString() method of my data struct
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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

Joined: Apr 20, 2006
Posts: 3344

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?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
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

Joined: Apr 27, 2006
Posts: 597
and that's leads me to the question , how can i output to string

such big data to string?
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: log4j and large string buffers
 
Similar Threads
log4j config file setup
Putting a string object to an output stream
Q 4 C. Bauer & G. King (11): database transactions
Log4j crap instructions
Reading logs from Unix server