You can use different logger names, different logger levels, and markers.
With these three levers, you can provide an incredible amount of
flexibility.

Gary

On Fri, Oct 29, 2021, 18:47 Ralph Goers <ralph.go...@dslextreme.com> wrote:

> I’m not sure I completely understand the question
> * I’m not sure what you mean by “additive default configuration”.
> Certainly you can have a default configuration. Use you can add to it.
> * Don’t log by default would mean that both onMatch and onMismatch are set
> to DENY
>
> Ralph
>
> > On Oct 29, 2021, at 3:20 PM, Marius Volkhart <mar...@volkhart.com>
> wrote:
> >
> > Hello all,
> >
> > I’m authoring a library that uses the Log4j API for internal logging. I
> want to provide my users valuable logging, but only under some
> circumstances. For example, if an expensive initializer gets called
> frequently, log a message indicating a possible performance impact. Or if
> logging something that may contain sensitive data, only logging it if they
> opt-in.
> >
> > I would typically solve this at the application layer using Filters. A
> ThresholdFilter and a MarkerFilter for example. Is there a way to provide
> an additive default configuration for my users? Or some other mechanism for
> saying “don’t log by default”? Or perhaps differently, am I wrong for
> thinking about the problem/solution this way?
> >
> > Thanks in advance!
> >
> >
> > Cheers,
> > Marius
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> > For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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