logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31662] New: - message property in LoggingEvent class not serializable
Date Tue, 12 Oct 2004 06:58:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31662>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31662

message property in LoggingEvent class not serializable

           Summary: message property in LoggingEvent class not serializable
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: yang.jenny@gmail.com


I wanted to use a JMSAppender to log java class instances. On the topic 
consumer side, I used a Message Driven Bean to retrive an object message
(LoggingEvent.getMessage()) and use the instanceof operator to determine its 
class so that I can cast it into the right class objects. The problem is, the 
message retrived from JMS topic is always a String object in LoggingEvent, 
although it is defined as Object type. This is due to message property in 
LoggingEvent is defined as transient, and in my view, it should be serializable 
instead so that object from logging source can be restored.

Here is the code sniplet:

LoggingEven evt = jmsMessage.getObject();
Object msg = evt.getMessage();
if (msg instanceof String) {
      // in the current log4j1.2.8 implementation, this will always be true 
coming out of JMS topic, which is wrong.
} else { msg instance of CallerProfile )  {
      // in the current log4j1.2.8 implementation, this will always be false, I 
would like to see msg=evt.getMessage() be serializable so that it could be true 
here. 
}



Regards,
Jenny

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message