I solved this one!
in ISPSvcException I had over-ridden printStackTrace
at one point it wrote null
log4j's VectorWriter added it in a String array
and later it tried to write it in a file and hence the NPE
Default PrintWriter is supposed to write a String object "null"
VectorWriter just ignores
I am using NullpointerException while logging error with log4j 1.2.14
hundreds of lines are printed in the log and console, before this error
occurs, so file configuration must be write
I m using it from inside RAD 6.0
logging line looks like
catch (ISPSvcException ise) {
-> logger.error("errr
In log4j 1.3 there is a ReflectionFilter that will use an object's 'toString'
method as the message. It then creates logging event properties out of any of
your object's JavaBeans-style properties before the logging event is passed on
to appenders.
It may be possible for you to backport it.
Y
you can log anything with log4j :-]
depending on what you want to do you can use one of the following
json:
http://www.json.org
or xstream:
http://xstream.codehaus.org/index.html
and either change your log requests:
log.debug( xstream.toXML(someObject));
or
write your own Layout
regards
patrick
Hi,
Can we log the java objects(seriablizble) into a logfile using log4j? If yes
please tell me some good link or example on this one.
Thanks in Advance
Sudhakar
--
View this message in context:
http://www.nabble.com/Logging-objects-tf2566625.html#a7153706
Sent from the Log4j - Users mailing lis