You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Vyom Jain <vy...@gmail.com> on 2016/04/04 14:23:36 UTC

Example RegexFilter using Pattern support added in LOG4J2-696

Hello Everyone!

Has anyone tried the feature implemented in LOG4J2-696
<https://issues.apache.org/jira/browse/LOG4J2-696> and would be interested
in sharing an example configuration which worked?

I've tried
<RegexFilter regex=".*test.*" onMatch="ACCEPT" onMismatch="DENY"
PatternFlags="DOTALL"/>

which gives an error ERROR RegexFilter contains an invalid element or
attribute "PatternFlags" during JVM startup.

Following doesn't work either -
<RegexFilter regex=".*test.*" onMatch="ACCEPT" onMismatch="DENY">
<PatternFlags><DOTALL/></PatternFlags>
</RegexFilter>

Also this information could be added in
http://logging.apache.org/log4j/2.x/manual/filters.html#RegexFilter.

--
Vyom

Re: Example RegexFilter using Pattern support added in LOG4J2-696

Posted by Ralph Goers <ra...@dslextreme.com>.
Gary,  

It doesn’t look like the RegexFilter is ever used in any test configurations.  From the factory method I would have expected to see a PatternFlagsPlugin to convert a container element into a String. Without a plugin I’m not sure how this will work.

Ralph

> On Apr 4, 2016, at 5:23 AM, Vyom Jain <vy...@gmail.com> wrote:
> 
> Hello Everyone!
> 
> Has anyone tried the feature implemented in LOG4J2-696
> <https://issues.apache.org/jira/browse/LOG4J2-696> and would be interested
> in sharing an example configuration which worked?
> 
> I've tried
> <RegexFilter regex=".*test.*" onMatch="ACCEPT" onMismatch="DENY"
> PatternFlags="DOTALL"/>
> 
> which gives an error ERROR RegexFilter contains an invalid element or
> attribute "PatternFlags" during JVM startup.
> 
> Following doesn't work either -
> <RegexFilter regex=".*test.*" onMatch="ACCEPT" onMismatch="DENY">
> <PatternFlags><DOTALL/></PatternFlags>
> </RegexFilter>
> 
> Also this information could be added in
> http://logging.apache.org/log4j/2.x/manual/filters.html#RegexFilter.
> 
> --
> Vyom



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: Example RegexFilter using Pattern support added in LOG4J2-696

Posted by Ralph Goers <ra...@dslextreme.com>.
Gary,  

It doesn’t look like the RegexFilter is ever used in any test configurations.  From the factory method I would have expected to see a PatternFlagsPlugin to convert a container element into a String. Without a plugin I’m not sure how this will work.

Ralph

> On Apr 4, 2016, at 5:23 AM, Vyom Jain <vy...@gmail.com> wrote:
> 
> Hello Everyone!
> 
> Has anyone tried the feature implemented in LOG4J2-696
> <https://issues.apache.org/jira/browse/LOG4J2-696> and would be interested
> in sharing an example configuration which worked?
> 
> I've tried
> <RegexFilter regex=".*test.*" onMatch="ACCEPT" onMismatch="DENY"
> PatternFlags="DOTALL"/>
> 
> which gives an error ERROR RegexFilter contains an invalid element or
> attribute "PatternFlags" during JVM startup.
> 
> Following doesn't work either -
> <RegexFilter regex=".*test.*" onMatch="ACCEPT" onMismatch="DENY">
> <PatternFlags><DOTALL/></PatternFlags>
> </RegexFilter>
> 
> Also this information could be added in
> http://logging.apache.org/log4j/2.x/manual/filters.html#RegexFilter.
> 
> --
> Vyom



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org