Hello all,

Having just finished testing the first implementation of a boolean
expression language for logging events, I'd like to explain its
salient features.

LBEL allows the user to write arbitrarily complex boolean expressions
relative to logging events. For example,

(level >= INFO AND method = 'foo') OR (logger CHILDOF 'some.package')

In other words, LBEL is a classical boolean expression language where
OR, AND, NOT and parentheses carry their usual precedence and meaning.
However, LBEL supports several sub-expressions and keywords specific
to the evaluation of logging events.

The implementation is designed to short-circuit the evaluation of the
right side of 'AND' and 'OR' expressions resulting in tremendous
performance gains in some cases. For example, if 'left-side' is true,
LBEL will skip the evaluation of the right side in the following
expression.

  (left-side) OR (right-side).

Similarly, if left-side is false, the right-side will not be evaluated
for AND expressions.

More formally, here is the grammar for LBEL

<bexp> ::= <bexp> 'OR' <bterm>
<bexp> ::= <bterm>
<bterm> ::= <bterm> 'AND' <bfactor>
<bterm> ::= <bfactor>
<bfactor> ::= NOT <bfactor>
<bfactor> ::= '(' <bexp> ')'
<bfactor> ::= 'level' <numerical_op> 'DEBUG'|'INFO'|'WARN'|'ERROR'
<bfactor> ::= 'message' <string_op> <litteral>
<bfactor> ::= 'logger' <string_op> <litteral>
<bfactor> ::= 'logger' 'CHILDOF' <litteral>
<bfactor> ::= 'timestamp' <numerical_op> <NUMBER>
<bfactor> ::= many other sub-expression could be easily added
<numerical_op> ::= '=' | '!=' | '>' | '>=' | '<' | '<='
<string_op> ::= '=' | '!=' | '>' | '>=' | '<' | '<=' | '~' | '!~'

'~' and '!~' designate regular expression macthing.

The usual grammar transformation techniques have been applied to put
the above grammar in LL(1) form so that it could be parsed top-down.

Most of the difficult parts of the implementation are done and
tested. If there are no objections, I will commit them shortly.


-- 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