I recently wrote an XMLSocketAppender so that I could write XML formatted messages to an XML receiver. (Apparently the Log4j thought is that XML formatted messages would be used to interject Log4j messages from non-java environments into Java environments, and that once a message was in the Java Log4j environment, it would never need to be sent in XML format, but I digress.)
Anyway, during my development efforts, I tried using the ObjectOutputStream to write a string to a reader that was expecting a byte buffer of characters. The ObjectOutputStream actually writes a few header bytes before writing the contents of the string. Those header bytes get read by the XML reader, and of course, they are not valid characters, and I was getting the same "illegal character" message you are talking about. (Now I use a different writer that only sends the appropriate bytes, of course.) Hope this gives you some more investigative options. --Mark -----Original Message----- From: Curt Arnold [mailto:[EMAIL PROTECTED] Sent: Monday, March 21, 2005 10:00 AM To: Log4J Users List Subject: Re: chainsaw and "escaping" XML entities On Mar 21, 2005, at 11:15 AM, Daniel Nebot wrote: > I am finding the same trouble than Mike(0xF/EOB-0x17)I would be very > grateful if somebody could suggest some workaround. > > Are you also reading log files written by log4net, or are you seeing the problem with log files written by log4j? I'm not sure if an illegal character would be reported as a fatal error (that is no continuation possible) or just an error from which we might be able to continue. However, in either case the right thing to do is to prevent non-wellformed XML entities from being written. The next question is what to do with illegal characters in XMLLayout. They could be dropped, replaced with a substitution character (likely ?) or expanded as a "\u000F" or similar. ( would still be an illegal character). --------------------------------------------------------------------- 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]
