> On Oct 5, 2023, at 6:13 AM, Thorsten Schöning <thorsten.schoen...@veda.net> 
> wrote:
> 
> Hi everyone,
> 
> I have many logger names following some naming convention like in the 
> following examples:
> 
> * org.example.unique_phrase.foo
> * org.example.unique_phrase.bar
> * org.example.foo.unique_phrase.bar
> * org.example.bar.unique_phrase.foo
> 
> The goal is to configure one file appender for all packages/logger names 
> containing "unique_phrase". At the same time I would like to keep the 
> possibility for more fine grained configs with possible different appenders 
> for different packages of the above example. The only solution I know of is 
> really configuring all individual (parent) logger names/packages with the 
> same appender. Would be easier if logger names would support some concept of 
> globs or regular expressions, so one might only use something like the 
> following name:
> 
> * org.example.*.unique_phrase.*
> 
> Is something like that possible, either out-of-the-box or possibly some 
> plugin or ...? Thanks!
> 

If this is what you really want then you could create a LoggerNamePatternFilter 
and configure it like

<Logger name=“org.example” level=“trace”>
   <AppenderRef ref=“patternAppender”>
     <LoggerNamePatternFilter pattern=“org.example.*.unique_phrase.*” 
onMatch=“NEUTRAL” onMisMatch=“DENY"/>
  </AppenderRef>
</Logger>

Ralph




---------------------------------------------------------------------
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