Hello Scott,

Java does not have operators such as >, >=, <, <= for comparing
strings. So using java's logical operators &&, || and ! is not
consistent with the rest of the expression language (using >, etc.).

From what I can tell so far, there is an almost 1 to 1 mapping between
boolean expressions for evaluating logging events and an SQL
expressions on an imaginary LOGGING_EVENT table, (assuming a
LoggingEvent table with columns timestamp, thread, logger, class,
method, message fields existed).

A sample SQL SELECT query on LOGGING_EVENT table looks like:

  SELECT * FROM LOGGING_EVENT WHERE logger = org.wombat AND method = foo;

In LBEL, the "FROM LOGGING_EVENT" part is implicit because log4j boolean
expressions are always relative to an event. In LBEL, the above SQL
select becomes:

  logger = org.wombat AND method = getPaper

Of course, there are differences. An SQL SELECT can return several
rows and columns whereas log4j boolean expressions only return true or
false.

The syntax of LBEL is heavily inspired from SQL. LBEL tries to adhere
to SQL conventions as much as possible which is one of the reasons why
keywords are case insensitive, and the operators AND, OR, NOT are used
instead of &&, ||, !.

At 09:32 PM 1/26/2005, Scott Deboy wrote:
This is a timely message, I've already written the lexer for the keywords/operators supported by ExpressionRule and I was about to write the parser.

This is very similar to ExpressionRule and its reliance on all of the rules in the o.a.l.rule package (of course).

I was going to do something very similar, and delegate the parser actions to the rules in the rule package.

Similarities to current expressionRule:

Some syntactic minor differences
AND/OR instead of &&/||, ~ instead of LIKE for regular expressions.

With support for the pattern match operator there is no need for the LIKE operator is there?

AndRule already doesn't evaluate the right hand side of the rule.

What is !~?

!~ is the opposite of ~.


-- Ceki G�lc�

  The complete log4j manual: http://www.qos.ch/log4j/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to