logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: Log4j2 script to generate hash
Date Tue, 08 Nov 2016 20:47:07 GMT
Where are you applying the filter? On the appender or somewhere else?

On 8 November 2016 at 13:13, Benjamin Jaton <benjamin.jaton@gmail.com>
wrote:

> hello,
>
> I was playing with log4j2 filters to generate a hash in groovy that I would
> put in the threadcontext map, and then use in my log pattern:
>
> %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1.}:%L - %m [%X{myhash}]
>
> But the hash is printed on the NEXT log message.
> My understanding is that at this point the log message is already formatted
> and final.
>
> Is there another way I can use a custom script where the log event can
> actually be modified?
>
> Thanks,
> Ben
>



-- 
Matt Sicker <boards@gmail.com>

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