[logback-user] Extending logback configuration

Rahul Narula ranarula at gmail.com
Tue Oct 16 02:14:22 CEST 2018


I have a default logback config. similar to the one below

<appender name="JSON_CONSOLE_APPENDER"
 <encoder class="a.b.c.logging.CustomLogbackEncoder">
   <provider class="a.b.c.logging.LogMaskingProvider">
    <!-- Read custom user rules --->

The above config is read and configured using the ImplicitAction without
any issue and binds to a POJO

public class Rules {

  private final Set<Rule> rules = new LinkedHashSet<>();

  public void addRule(Rule definition) {


acts as a default configuration. This default configuration is not directly
available to the clients, so they can't directly make changes to it.

I am looking for ways to extend this default configuration where in the
different users can specify additional rules in <userRules>. This
configuration is provided in separate file outside of logback.xml in a file
called custom.xml something like


I am looking for help to implement this so as that the logback config is
configured with the set of default + custom rules

Any pointers around how to implement this will be helpful
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20181015/e11edda5/attachment.html>

More information about the logback-user mailing list