I'm not really interested in logging any object, I'm more interested in
putting a blob into a logging event that I can extract later. It would
also be nice if the setProperty supported primitive data types (int,
long, float) without having to convert them into a string.
Ceki G�lc� wrote:
Log4j's ability to log any object relies on only one premise: any
java object can be transformed into a String. The Object class
contains a toString method and every java object is an instance of the
Object class. However, the toString() method does not always yield the
desired results, which is where ObjectRenderers come into play.
The code that selects the appropriate ObjectRenderer for a given
object (to be logged) relies on two Java primitives. First, the code
must be able to determine the class of the object being
rendered. Second, it must be able to walk the class hierarchy of the
object in question, including interfaces as well as super-classes. The
rest is pretty straight forward.
I have not coded in C++ for along time so I can't remember whether
any of the above is available in C++.
At 06:46 PM 8/27/2004, Jack Strohm wrote:
I was wondering if there has been any thought to the ability to log a
binary stream of data? With log4j you can log any object, but
log4cxx only handles strings (in both properties and the message).
Thank for any input you can give me as to how difficult this might be
if I wanted to do this myself.
- jack