log4japache-chainsaw

Color settings in Chainsaw


I'd like to set one color for each thread name in Chainsaw (Developer snapshot)

e.g:

enter image description here

Now I set this manually:

enter image description here

but I was wondering if it can be done automatically, without creating rule for each thread name. Do you know if it is possible?


Solution

  • I'm one of the Chainsaw committers, and I wrote the color handling code.

    I see in your screenshot the threads are tied to requests. I'd like to get a better idea of what you are trying to do, because Chainsaw can do a lot of things and there may be a way to do what you want today.

    So..a question - are you using a log file to get this info, or are you using a socketappender?

    Using the Logger tree to view each request: If you are using a log file, I'd suggest just mapping the 'thread name' as the 'logger' field, then you can use the logger tree on the left - click on a logger name (request123456) and then click on the magnifying glass button above the logger tree in order to 'focus on' and view only that request.

    Using individual tabs for each request: If you are using a socketappender, I'd suggest block all threads that don't start with 'request' in the new 'Ignore' dialog below the logger tree, and then change the 'tab name/routing expression' in Chainsaw to THREAD - that will create a new tab for each thread.

    Programmatically generating colors for each thread is definitely possible but would probably end up generating ugly colors...if this doesn't work for you I can think about that one a bit.

    Scott