Use the getLocationInformation() method on LoggingEvent prior to
serializing...



-----Original Message-----
From: Sanjay Gupta (sanjaygu) [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 10:37 AM
To: 'Steve Ebersole'; 'Log4J Users List'
Subject: RE: Serialization of LoggingEvent message field


My opologies, I meant LocationInfo.

-Sanjay

-----Original Message-----
From: Steve Ebersole [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 6:02 PM
To: Log4J Users List; [EMAIL PROTECTED]
Subject: RE: Serialization of LoggingEvent message field


What do you mean by "Localization Info"?  Are you talking about the
LocationInfo object?  Or some kind of custom i18n/localized data?



-----Original Message-----
From: Sanjay Gupta (sanjaygu) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 8:04 PM
To: [EMAIL PROTECTED]
Subject: Serialization of LoggingEvent message field


Hi,

I am sending the LoggingEvent over wire (SocketAppender). The message
object in my case is a custom object I created called a LoggerMessage.
This is a simple container class which holds multiple fields (all
serializable) that we need to transfer over the wire.  Now obviously we
are unable to transfer this due to the the fact that message object in a
LoggingEvent is not serialized. So, how do I send the LoggingEvent with
my Custom Message Object. Here is what I tried - 1. One solution I  came
up with was to wrap the LoggingEvent object and our LoggerMessage object
in a serializable wrapper class that we created, and transfer that over
the wire.  Then on the other end, we deserialize the wrapper from the
stream, pull out the LoggerMessage and the LoggerEvent out, and assign
the LoggerMessage to the LoggingEvent as its message field (overwriting
the String value that it would have after the serialization process).
However, this is where we ran into our problem. There is no setter
method to set the message object in a LoggingEvent. 2. Another solution
I came up with was to xml-ize the LoggingEvent Object info and then
create a LoggingEvent object on the other end. But then how do I set
Localization Info?

Anone has any thoughts how to achieve this?

Regards,
-SAnjay



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to