Re: How to filter specific characters to not to log

2006-09-22 Thread Praveen Kumar Hasthalapuram

Thanks Bender/Curt.

I have fixed this issue by reading byte value for each control character if
any and replacing with space. i.e. All the control chars fall under range (0
- 32) byte.
so that it cant break the xml report. It is working fine :-)

Thanks  Regards,
 --Praveen


On 9/20/06, Bender Heri [EMAIL PROTECTED] wrote:


A common way to enter binary data in xml is

- use base64 encoding  (not readable for humans, size is one third bigger
than original)
- translate to hex string (readable for humans, size is twice as big than
original)

Heri

 -Original Message-
 From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 19, 2006 8:03 PM
 To: Log4J Users List
 Subject: [SPAM (Bayesain Analysis)] - Re: How to filter specific
 characters to not to log - Bayesian Filter detected spam


 Hi Curt,

 We are facing problems with this chatacter  #0; issue,

 Is there any standard convention for representing a character
 of value 0 in
 XML
 (and other control characters)?  I understand that we can't
 actually *have*
 such a character - that's why #0; is illegal - but sometimes
 we want to
 output
 data that includes such characters.

 or How to escape these characters in xml report.

 Regards,
 Praveen


 On 9/19/06, Curt Arnold [EMAIL PROTECTED] wrote:
 
  XMLLayout in both 1.2 and 1.3 can produce bad XML in several
  scenarios as reported in bugs 29244, 34875 and 37560.
 Since I was an
  XML guru in a former life, I know of additional holes in the
  implementation.  If you'd be interested in testing it, I
 could take a
  shot at re-implementing XMLLayout.  I think that would be a better
  solution than trying to filter content to avoid the bugs.
 
  On Sep 18, 2006, at 1:09 PM, Praveen Kumar Hasthalapuram wrote:
 
   Hi,
  
   We will get these characters from the devices and these data we
   will log.
   These logged data will be used to generate xml reports. With some
   devices
   we are getting some control characters (some spl symbols)
 and these
   are
   causing xml report to fail. Is it possible to strip this
 characters or
   filter this types of characters.
  
   Regards,
   Praveen
  
 
 
 
 -
  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]




Re: How to filter specific characters to not to log

2006-09-22 Thread Curt Arnold
I've thought about the handling of prohibited character codes in  
XMLLayout and my current thought is they should be represented using  
Java-style escape sequences, that is if you did:


logger.info(\u\u0145);

You would get something like:

log4j:message logger=... level=...\uamp;#x0145;/ 
log4:message


Using nested elements in the message to represent prohibited  
character codes seemed undesirable since it could not be used to  
represent prohibited codes when the codes appear in logger or level  
names (since nested elements could not appear within attributes).   
The downside of Java-escaping or substituting for prohibited codes is  
that you could not distinguish between:


logger.info(\u\u0145);
logger.info(\\u\u0145);

Where the first instance had a prohibited character and the second  
was legal.  If desired, could possibly add an attribute that  
indicated that a substitution occurred somewhere in the element  
(either in the logger name, level name, message, MDC, et al) and  
could possibly return a total count.  It would not allow you to  
identify where the bad characters appeared.  Something like:


log4j:message substitions=1\uamp;#x0145;/log4:message




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



Re: How to filter specific characters to not to log

2006-09-20 Thread Bender Heri
A common way to enter binary data in xml is

- use base64 encoding  (not readable for humans, size is one third bigger than 
original)
- translate to hex string (readable for humans, size is twice as big than 
original)

Heri

 -Original Message-
 From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 19, 2006 8:03 PM
 To: Log4J Users List
 Subject: [SPAM (Bayesain Analysis)] - Re: How to filter specific
 characters to not to log - Bayesian Filter detected spam
 
 
 Hi Curt,
 
 We are facing problems with this chatacter  #0; issue,
 
 Is there any standard convention for representing a character 
 of value 0 in
 XML
 (and other control characters)?  I understand that we can't 
 actually *have*
 such a character - that's why #0; is illegal - but sometimes 
 we want to
 output
 data that includes such characters.
 
 or How to escape these characters in xml report.
 
 Regards,
 Praveen
 
 
 On 9/19/06, Curt Arnold [EMAIL PROTECTED] wrote:
 
  XMLLayout in both 1.2 and 1.3 can produce bad XML in several
  scenarios as reported in bugs 29244, 34875 and 37560.  
 Since I was an
  XML guru in a former life, I know of additional holes in the
  implementation.  If you'd be interested in testing it, I 
 could take a
  shot at re-implementing XMLLayout.  I think that would be a better
  solution than trying to filter content to avoid the bugs.
 
  On Sep 18, 2006, at 1:09 PM, Praveen Kumar Hasthalapuram wrote:
 
   Hi,
  
   We will get these characters from the devices and these data we
   will log.
   These logged data will be used to generate xml reports. With some
   devices
   we are getting some control characters (some spl symbols) 
 and these
   are
   causing xml report to fail. Is it possible to strip this 
 characters or
   filter this types of characters.
  
   Regards,
   Praveen
  
 
 
  
 -
  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]



Re: How to filter specific characters to not to log

2006-09-19 Thread Praveen Kumar Hasthalapuram

Hi Curt,

We are facing problems with this chatacter  #0; issue,

Is there any standard convention for representing a character of value 0 in
XML
(and other control characters)?  I understand that we can't actually *have*
such a character - that's why #0; is illegal - but sometimes we want to
output
data that includes such characters.

or How to escape these characters in xml report.

Regards,
Praveen


On 9/19/06, Curt Arnold [EMAIL PROTECTED] wrote:


XMLLayout in both 1.2 and 1.3 can produce bad XML in several
scenarios as reported in bugs 29244, 34875 and 37560.  Since I was an
XML guru in a former life, I know of additional holes in the
implementation.  If you'd be interested in testing it, I could take a
shot at re-implementing XMLLayout.  I think that would be a better
solution than trying to filter content to avoid the bugs.

On Sep 18, 2006, at 1:09 PM, Praveen Kumar Hasthalapuram wrote:

 Hi,

 We will get these characters from the devices and these data we
 will log.
 These logged data will be used to generate xml reports. With some
 devices
 we are getting some control characters (some spl symbols) and these
 are
 causing xml report to fail. Is it possible to strip this characters or
 filter this types of characters.

 Regards,
 Praveen



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




How to filter specific characters to not to log

2006-09-18 Thread Praveen Kumar Hasthalapuram

Hi,

I want to filter some specific characters (special chars) , so that it
should not log.

Can anyone suggest me how to it?

Thanks,
Praveen


Re: How to filter specific characters to not to log

2006-09-18 Thread Bender Heri
Can you explain where these characters occur? Are they within a String supplied 
as msg argument in log calls? Or where?
Heri

 -Original Message-
 From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 18, 2006 4:02 PM
 To: log4j-user@logging.apache.org
 Subject: [SPAM (Bayesain Analysis)] - How to filter specific 
 characters
 to not to log - Bayesian Filter detected spam
 
 
 Hi,
 
 I want to filter some specific characters (special chars) , so that it
 should not log.
 
 Can anyone suggest me how to it?
 
 Thanks,
 Praveen
 

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



Re: How to filter specific characters to not to log

2006-09-18 Thread Praveen Kumar Hasthalapuram

Hi,

We will get these characters from the devices and these data we will log.
These logged data will be used to generate xml reports. With some devices
we are getting some control characters (some spl symbols) and these are
causing xml report to fail. Is it possible to strip this characters or
filter this types of characters.

Regards,
Praveen


On 9/18/06, Bender Heri [EMAIL PROTECTED] wrote:


Can you explain where these characters occur? Are they within a String
supplied as msg argument in log calls? Or where?
Heri

 -Original Message-
 From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 18, 2006 4:02 PM
 To: log4j-user@logging.apache.org
 Subject: [SPAM (Bayesain Analysis)] - How to filter specific
 characters
 to not to log - Bayesian Filter detected spam


 Hi,

 I want to filter some specific characters (special chars) , so that it
 should not log.

 Can anyone suggest me how to it?

 Thanks,
 Praveen


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




Re: How to filter specific characters to not to log

2006-09-18 Thread Curt Arnold
XMLLayout in both 1.2 and 1.3 can produce bad XML in several  
scenarios as reported in bugs 29244, 34875 and 37560.  Since I was an  
XML guru in a former life, I know of additional holes in the  
implementation.  If you'd be interested in testing it, I could take a  
shot at re-implementing XMLLayout.  I think that would be a better  
solution than trying to filter content to avoid the bugs.


On Sep 18, 2006, at 1:09 PM, Praveen Kumar Hasthalapuram wrote:


Hi,

We will get these characters from the devices and these data we  
will log.
These logged data will be used to generate xml reports. With some  
devices
we are getting some control characters (some spl symbols) and these  
are

causing xml report to fail. Is it possible to strip this characters or
filter this types of characters.

Regards,
Praveen




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