I would chose the approach by a self written renderer, which is configured like
this:
<renderer renderedClass="ch.ergonomics.pms.common.supervision.MessageLogger"
renderingClass="ch.ergonomics.pms.common.supervision.MessageLogger"/>
The rendering class is your self written renderer which implements log4j
ObjectRenderer (method doRender()).
The rendered class is the one you pass to calls like logger.debug() (the formal
parameter of this calls is Object and not String, you can pass any java or self
defined class. If no renderer for this class is configured, the toString()
method is used to render the class).
Heri
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Satyendra
> Srivastava
> Sent: Monday, July 10, 2006 10:21 PM
> To: [email protected]
> Subject: [SPAM (Bayesain Analysis)] - Re: Filtering out data while
> logging. - Bayesian Filter detected spam
>
>
>
> OOMS DIRK <Ext.Dirk.Ooms <at> siemens.be> writes:
>
> >
> > I would put AccountNo, SecretCode, etc in MDC key-value
> pairs and apply an
> > appropriate PatternLayout that leaves out the MDC fields
> you don't want to
> > show.
> >
> > dirk
> >
> > > -----Original Message-----
> > > From: Tasso The Developer [mailto:jappdev <at> hotmail.com]
> > > Sent: woensdag 2 februari 2005 17:03
> > > To: log4j-user <at> logging.apache.org
> > > Subject: Filtering out data while logging.
> > >
> > >
> > > How would I go about masking or removing certain information
> > > so it doesn't
> > > get logged?
> > >
> > > For instance...
> > >
> > > log.info("Received data from partner: AccountNo=12345, Secret
> > > Code=qwerty;
> > > MessageCode=100");
> > >
> > > So in the log it would look like...
> > >
> > > Received data from partner: Account=12345, Secret Code=******;
> > > MessageCode=100
> > >
> > > _________________________________________________________________
> > > Take charge with a pop-up guard built on patented Microsoft(r)
> > > SmartScreen
> > > Technology.
> > > http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&
> > > DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> > > Start enjoying all the benefits of MSN(r) Premium right now
> > > and get the
> > > first two months FREE*.
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe <at>
> logging.apache.org
> > > For additional commands, e-mail: log4j-user-help <at>
> logging.apache.org
> > >
> >
>
>
> Hi Dirk/All,
>
> I have similar type of requirement. I have some xml string like...
> <payload>
> <acctNumber>1000101010</acctNumber>
> <productCode>123234</productCode>
> < ..... > //More fields
> ...
> ...
> < ..... >
> </payload>
>
> I would like to Display this xml as
>
> <payload>
> <acctNumber>******1010</acctNumber>
> <productCode>******</productCode>
> < ..... > //More fields
> ...
> ...
> < ..... >
> </payload>
>
> I don't have xsd schema for payload. This is dynamic ("Any"
> type). All I have
> is the field names which need to be masked (e.g.
> acctNumber,productCode ).
> Please help me with some code fragment. I am new to log4j.
>
> Thanks
> Satyendra
>
>
>
> ---------------------------------------------------------------------
> 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]