Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DefaultRuleListener and DefaultRulesEngineListener #223

Closed
liebig opened this issue Aug 1, 2019 · 4 comments
Closed

Remove DefaultRuleListener and DefaultRulesEngineListener #223

liebig opened this issue Aug 1, 2019 · 4 comments
Milestone

Comments

@liebig
Copy link

liebig commented Aug 1, 2019

Thank you very much for this great library. I wanted to ask if it is possible to remove the DefaultRuleListener from the Rule Listener.

DefaultRulesEngine rulesEngine = new DefaultRulesEngine(new RulesEngineParameters().skipOnFirstFailedRule(true)); rulesEngine.getRuleListeners().clear(); does not work.

Thank you
Marc

@fmbenhassine
Copy link
Member

Thank you very much for this great library.

Thank you! Glad you like it!

rulesEngine.getRuleListeners().clear(); does not work.

This does not work because of #157 .

I wanted to ask if it is possible to remove the DefaultRuleListener from the Rule Listener.

yes that's possible, it is not the first time someone asks to remove it (See #146). However, I wanted to know the motivation of this request. Can you please explain why do you want to remove it?

@fmbenhassine
Copy link
Member

ok, yet another time I see people removing default listeners: #215 (comment). There should be a good reason (which I fail to see) for all these people to do that.

So I will remove them in the next major release.

@liebig
Copy link
Author

liebig commented Nov 6, 2019

Hi benas,

Please excuse my late reply. Somehow I overlooked your query. We want to remove the DefaultRuleListener to define our own default listener. Here we would like to adjust the logging and also the logging format.

I am very pleased to hear that this will be possible from the next major release.

Thank you so much for your great work.

Many greetings from Germany
Marc

@fmbenhassine fmbenhassine changed the title Remove DefaultRuleListener Remove DefaultRuleListener and DefaultRulesEngineListener Dec 8, 2019
@pnewhook
Copy link

pnewhook commented May 8, 2020

To clarify why we might want to remove the DefaultRulesEngineListener, I'm finding that at high volumes, logging in the DefaultRulesEngineListener is taking more time than actually evaluating the rules. Even when logging is set to WARN or ERROR, the call to String.valueOf(fact.getValue()) is evaluated and relatively expensive. Thank you for removing it.

DefaultRulesEngineListener Logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants