Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Apache
After thinking about this more I can’t quite figure out what the user would be specifying in the configuration. A Java lambda expression? I.e what is the rule syntax? Or are they expected to just configure predefined rules with perhaps some variables. But if that is the case how is this really

Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Ralph Goers
This sounds interesting. I might give it a whirl but firstI am trying to finish up some work on Apache Flume so it can get a new release and I need to do some other work here as we are overdue for a release. Ralph > On Oct 21, 2021, at 11:28 AM, Adwait Kumar Singh > wrote: > > The

Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Adwait Kumar Singh
The problem I am stuck on is the best way to get the user to provide the ruleSupplier via configuration. On Thu, Oct 21, 2021 at 11:55 PM Adwait Kumar Singh < theadvaitkumarsi...@gmail.com> wrote: > Yes I mean filtering on those loggers. > > I don't expect the Supplier to be dynamically changed,

Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Adwait Kumar Singh
Yes I mean filtering on those loggers. I don't expect the Supplier to be dynamically changed, only the rules they are fetching. Something roughly like this public class RuleBaseFilter extends AbstractFilter { //This will be initialized only once Supplier> rulesSupplier; @Override

Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Ralph Goers
Sorry, you have lost me a little bit. When you say dynamically turn on/off loggers I am assuming you really mean enable/disable filtering on those Loggers? Are you thinking that the rules can be added or removed dynamically? Or just the parameters to the rules? I ask because you can’t really

Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Adwait Kumar Singh
This is still in the proof of concept phase, but what I am trying to do is create a filter which allows developers to dynamically turn on/off loggers based on some parameters without restarting their system. The parameters can be varied, like: 1. Turn on WARN log levels of a particular class. 2.

Re: How to inject a dependency into a custom filter.

2021-10-21 Thread Apache
It sounds to me like you want to create a new type of plugin similar to PatternConerters. I am curious as to what your filter does. Is it something that would be useful to others so that we would be interested in including it? Ralph > On Oct 21, 2021, at 6:07 AM, Adwait Kumar Singh > wrote:

How to inject a dependency into a custom filter.

2021-10-21 Thread Adwait Kumar Singh
I am creating a filter which requires the user to give a Supplier to fetch some custom rules. I am wondering how to go about getting this Supplier from the configuration xml. One way I have thought of is using some sort of Registry and then just asking the user to provide a key to lookup into the