See https://issues.apache.org/jira/browse/LOG4J2-1137 
<https://issues.apache.org/jira/browse/LOG4J2-1137>. It has been on my todo 
list for quite a while. What I plan on implementing is a “TriggeringAppender” 
where you can attach a custom trigger or triggers to cause the event to fire. 
The problem I haven’t figure out is in capturing and emitting the events. It 
should use a ring buffer but when the event fires you don’t want to cause a 
pause while all the events are logged so you would probably need more than one 
RingBuffer. And what if the trigger fires again before the first trigger has 
logged all the events? I want to figure out this behavior before I start 
writing it and I just haven’t had the time to design it.

Ralph

> On Nov 24, 2019, at 8:52 PM, hmijail+lo...@gmail.com wrote:
> 
> Hi all,
> 
> I am looking for a way to do a lookahead regex filter: ignore log lines, 
> unless there is a match with a given pattern, in which case the N previous 
> lines should be stored. 
> 
> The RegexFilter filter doesn't seem to support this, or at least I haven't 
> managed to make it work. (I would have been surprised to find it worked 
> anyway)
> 
> Any tip on how to do this kind of thing?
> 
> Best,
> --- Horacio
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> 

Reply via email to