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: new feature proposal - microloggers
Date Fri, 24 Nov 2017 17:27:34 GMT
On 23 November 2017 at 06:37, Remko Popma <remko.popma@gmail.com> wrote:

> If you use a RegexFilter (
> https://logging.apache.org/log4j/2.x/manual/filters.html#RegexFilter)
> would
> that meet your requirements?
>
> >         <logger name=" org.springframework.beans.factory.support.
> DefaultListableBeanFactory"
> > level="DEBUG">            <include string= "Creating shared instance of
> > singleton bean"            <AppenderRef ref="PROJECT" />
> >         </logger>
>

Example usage:

<Logger name="com.example.thing" level="DEBUG">
  <RegexFilter regex="Creating shared instance of singleton bean"
onMismatch="DENY"/>
  <AppenderRef ref="PROJECT"/>
</Logger>

You can set that filter at the global level (inside <Configuration/>),
per-appender (inside the <FooAppender/> element), per-logger (as
described), or even inside the <AppenderRef/> element which can be useful
if your <Logger/> has multiple AppenderRefs. See more info here: <
https://logging.apache.org/log4j/2.x/manual/configuration.html#Filters>

-- 
Matt Sicker <boards@gmail.com>

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