The process for defining a color rule is pretty straightforward.

- Define color rules
- Order the rules
- Apply

Color rules for each logpanel are loaded and saved automatically when the app is 
opened and closed.

Here are instructions for navigating the GUI:

* Select a tab that has events and either use the 'current tab-log panel color filter' 
menu item or right-click 
  in the table and select 'logpanel color filter'

* Press the 'new' button to add a row to the color rules list (feel free to delete the 
default rules if you don't want them).

* double-click on the first column of the newly-inserted row

* Build the expression you are interested in coloring (the right click and ctrl-space 
context menus are available here in order to
  assist in the expression-building process).  

* Once you have defined your expression, click on the 'background' cell for the row 
you are defining - a drop down list will appear
  with some default-defined colors.  Select one of the colors or choose 'browse' at 
the bottom of the list to define a custom color.

* Do the same to the 'foreground' cell if you are interested in changing the 
foreground.

* Reorder the rules by selecting a rule (selected rule has a triangle cursor to the 
left of the expression), and pressing 
  the UP or DOWN arrows.

  NOTE: Events are evaluated against color rules in the order they are listed on this 
window, so 
        the first matching rule is the color that will be applied to the event in the 
logpanel.

* Delete any existing rules you are not interested in applying.

* Hit the Apply button.

* If you have entered an invalid expression after applying the rules and an the 
expression is not valid, there will be a message 
  at the bottom of the dialog instructing you to examine the row's tool tips for an 
explanation.

There is the concept of 'rulesets' which aren't implemented yet.  The idea was 
providing the ability to define a group of color rules and apply them as a group.

Hope this explains the color filter process a little better.

We'd love to hear any input you're interested in providing.

Scott


-----Original Message-----
From: Kloeck, Erwin [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 05, 2004 1:08 AM
To: Log4J Users List
Subject: AW: chainsaw v2 filtering


Scott,

thanks for the explanation. 

I suggest that you take a copy of your email and paste it into the chainsaw v2 
tutorial. This would be a great improvement to what is there currently :-).

Since you mentioned it, could you give an example of a coloring rule as well.

Thanks again,

Erwin

-----Urspr�ngliche Nachricht-----
Von: Scott Deboy [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 2. April 2004 18:55
An: Log4J Users List
Betreff: RE: chainsaw v2 filtering


Glad you're trying it!  My apologies that there is no documentation to speak of other 
than the javadocs.

The == operator performs an equals check.

I'd suggest either using a partial text match rule: msg ~= 'current' or a regular 
expression rule: msg LIKE 'Current.*'

One tip: right-clicking in the 'refine focus' field (or pressing
ctrl-space) will bring up a context-sensitive popup menu which can show you available 
operators, keywords, and in some cases the list of unique values based on your current 
context (if the refine focus field has the text "logger == ", then right-clicking the 
mouse at the end of the partial expression should pop up with a list of the available 
loggers.

Here is a quick rundown of expression support in Chainsaw v2, which you can use to 
build 'refine focus' or color rules:

1. Operands and operators must be separated by spaces (I'm relying on stringtokenizer 
to parse the expression - I'll work on using a parser at some point)

2. Single tick marks can be used to delimit multi-word text (example: msg ~= 'my msg')

3. Parens can be used to group expressions (just remember to put spaces around them)

4. Supported field identifiers: 
        LOGGER
        LEVEL
        CLASS
        FILE
        LINE
        METHOD
        MSG
        NDC
        EXCEPTION
        TIMESTAMP
        THREAD
        MDC
        PROP (properties)

5. To build expressions using MDC or properties, the key you're evaluating needs added 
after the keyword.  For example, since each row provides a 'log4jid' property (used 
during import/export of events from Chainsaw), you could refine the display to only 
show rows 50 through 60 by building this expresssion:

PROP.log4jid >= 50 && PROP.log4jid <= 60

6. Supported operators:
        ==              equals
        ~=              case-insensitive partial-text match
        !=              not equals
        LIKE            supports regular expressions
        EXISTS  not null

        < 
        <=              inequality operators
        >
        >=

        &&              logical and
        ||              logical or
        !               logical not

A couple of notes on operators:
- The equality operator can be used with the LEVEL identifier, but since it's 
performing a .equals, you need 
  to make sure to use uppercase for the right-hand value (LEVEL == WARN instead of 
LEVEL == warn)
- Inequality operators are supported for Levels (LEVEL > INFO) and anything that can 
be converted to a numeric 
  value.  You don't have the case-sensitivity issue with inequality operators and the 
Level identifier that 
  you do with the equality operator.

Let me know if you have further questions,

Scott
        
-----Original Message-----
From: Kloeck, Erwin [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 1:55 AM
To: [EMAIL PROTECTED]
Subject: chainsaw v2 filtering


Hi,

I have trouble getting filtering to work. I would need an example of what I have to 
type into the 'Refine focus on:'-field to get all entries with a message starting with 
e.g. 'Current heap size:' ?

I tried "msg == 'Current.*' " but this did not work. Where am I going wrong?

Thanks for your help.

Erwin


..............................

Erwin Kloeck
Produktentwicklung

Oestreicher + Wagner 
Medientechnik GmbH
Frankenthaler Strasse 20
D-81539 Muenchen

Fon   +49 (0)89-68961 216 
Fax   +49 (0)89-68961 271


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


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


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


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

Reply via email to