Skip to content

Commit 01d3b41

Browse files
committed
Added debug logging to help figure out what is going on during rule execution.
1 parent 4ac7f58 commit 01d3b41

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/rule/Join.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
public class Join implements IJoin
5050
{
5151
private static final String JOIN_DISABLED_KEY = Join.class.getName() + "_DISABLED";
52-
private static final String JOIN_DISABLED_RESET_NEXT_KEY = Join.class.getName() + "_DISABLED_RESET_NEXT";
5352

5453
private static final String CURRENT_JOIN = Join.class.getName() + "_current";
5554

‎impl-servlet/src/main/java/org/ocpsoft/rewrite/servlet/impl/DefaultHttpRewriteProvider.java‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,18 @@ public void rewriteHttp(final HttpServletRewrite event)
8989
final List<Rule> list = provider.get(cacheKey);
9090
if (list != null && !list.isEmpty())
9191
{
92-
for (Rule rule : list) {
92+
log.debug("Using cached ruleset for event [" + event + "] from provider [" + provider + "].");
93+
for (int j = 0; j < rules.size(); j++)
94+
{
95+
context.clear();
96+
Rule rule = rules.get(j);
9397
if (rule.evaluate(event, context))
9498
{
99+
log.debug("Rule [" + rule + "] matched and will be performed.");
100+
95101
List<Operation> preOperations = ((EvaluationContextImpl) context).getPreOperations();
96-
for (int j = 0; j < preOperations.size(); j++) {
97-
preOperations.get(j).perform(event, context);
102+
for (int k = 0; k < preOperations.size(); k++) {
103+
preOperations.get(k).perform(event, context);
98104
}
99105

100106
if (event.getFlow().is(Flow.HANDLED))
@@ -135,10 +141,11 @@ public void rewriteHttp(final HttpServletRewrite event)
135141
Rule rule = rules.get(i);
136142
if (rule.evaluate(event, context))
137143
{
144+
log.debug("Rule [" + rule + "] matched and will be performed.");
138145
cacheable.add(rule);
139146
List<Operation> preOperations = context.getPreOperations();
140-
for (int j = 0; j < preOperations.size(); j++) {
141-
preOperations.get(j).perform(event, context);
147+
for (int k = 0; k < preOperations.size(); k++) {
148+
preOperations.get(k).perform(event, context);
142149
}
143150

144151
if (event.getFlow().is(Flow.HANDLED))

0 commit comments

Comments
 (0)