logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Deboy <scott.de...@gmail.com>
Subject Re: Omit xml part
Date Mon, 08 Nov 2010 17:52:14 GMT
To elaborate on Josef's suggestion - you can use a RewriteAppender.  The
RewriteAppender will forward events to an appender after allowing the
RewritePolicy to modify the event.  Your logic to remove the field from the
message would be provided by your own RewritePolicy implementation.

JavaDoc here (part of the 'receivers' companion):
http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/log4j/rewrite/package-summary.html

Scott

On Mon, Nov 8, 2010 at 5:08 AM, Stadelmann Josef <
josef.stadelmann@axa-winterthur.ch> wrote:

> Or you may have to write your own filter to filter-out unwanted messages to
> get to your appender.
> Josef
>
> -----Ursprüngliche Nachricht-----
> Von: Thorbjørn Ravn Andersen [mailto:nospam0002@gmail.com]
> Gesendet: Dienstag, 2. November 2010 21:58
> An: Log4J Users List
> Betreff: Re: Omit xml part
>
> Den 02/11/10 10.25, Alexander Curvers skrev:
> > Hello,
> >
> > i send some binary data in xml messages with my webservices.. I log
> > all communication for debugging purposes. The problem is the binary
> > value gets logged as well making the log very big.. I want to log the
> > rest of the xml but just not the one field/property containing the
> > binary data.. can i configure Log4j to just not log that line/property
> > of the xml message?
>
> Not immediately, but you can use the XSLT implementation available in
> the Java Runtime to remove the binary value from your XML before logging
> it.
>
> --
>   Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message