views:

84

answers:

3

I'm looking for a text editor for reading log4j log files capable of auto-highlighting lines according to the threads that logged them. For example, all the lines which include [pool-1-thread-1] will be colored yellow and all the lines which include [pool-1-thread-2] will be colored green. This might be available as a more general feature of highlighting according to the contents of some regex match.

What tools support this feature?

If you know a way I'm not aware of to do it in EditPLus or UltraEdit -- even better.

EDIT: My files are plaintext (not XML), and I can't change that.

A: 

Apache Chainsaw may be of use to you. It's a dedicated Log4j viewer written by members of the Log4j team. Note that it's not an editor, but may actually be more useful.

Brian Agnew
If I understand correctly, it requires the files to be in XML format, so I won't be able to use it.
Oz
I would expect that you can configure your application with an additional appender, and then Chainsaw will talk to this. See the http://logging.apache.org/chainsaw/zeroconf.html page for more info.
Brian Agnew
No, I can't configure the application (it's not "mine" to configure...).
Oz
Chainsaw can parse and tail regular text log files, using a LogFilePatternReceiver. See the JavaDoc from Chainsaw's help menu and an example receiver configuration on Chainsaw's Welcome tab.
Scott
A: 

Chainsaw V2 -can- parse regular text log files (using a LogFilePatternReceiver or VFSLogFilePatternReceiver - see the javadoc in Chainsaw's help menu), and does support colorizing rows based on user-defined expressions (you can assign a color to all entries matching the expression 'thread == pool-1-thread-2').

With the very latest version (svn HEAD), you can also -annotate- the log file (an editable column that allows you to enter notes about the log). You can then save that log file (as xml) and load it later and your annotations are preserved.

Scott
A: 

You could log into XML files and let them get parsed by the Logpool

Here you can get some Documentation (http://ovh.dl.sourceforge.net/project/log4jpool/readme.pdf)

Christian Requena