0

I'm trying to find a tool to analyze a bunch of log files generated by log4j and ended up with Apache Chainsaw. Unfortunately, I could not find adequit documentations to help how to use it. All what I was able to do is viewing the result of one log file only.

Does anyone know how to load more than one file at the same time and view them in one tab?

Any helpful documentation?

Any other tools ?

Thanks

xav
  • 5,452
  • 7
  • 48
  • 57
Greg
  • 411
  • 2
  • 6
  • 15

2 Answers2

0

You can use LogMX. Using the free version, go to "File" > "Configure Log Parsers...", click on the "+" green button at the right to create a Parser, then click on the tab "Log4j/Logback pattern" tab, then paste your Log4j pattern (the one you specified in your log4j config file, usually something like "%d %level [%thread] %c - %m")

LogMX can open multiple log files and display their content in a single merged view:

  • if all the files are in the same directory (local or remote), simply go to "File" > "Open logs...", then check the tab "Merge" at the bottom

  • if all the files are NOT in the same directory, go to "File" > "Open several logs in a merged view", then click the "+" green button at the right for each file you want to include

  • if all the files are already loaded in LogMX, you can use "Tools" > "Merge logs..."

xav
  • 5,452
  • 7
  • 48
  • 57
  • Hi I have been trying to load Solr log files generated by log4js in LogMX but failed, as no suitable log parser found. When I create new log parser with pattren ```"%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n"``` and open solr.log file, it just shows plain text. I am a newbie please share tips or any links to help as I cant find online help to use LogMX. – MyO Jan 09 '21 at 10:52
  • 1
    @MyO This pattern should work in LogMX: `%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%mx{collection} %mx{shard} %mx{replica} %mx{core}] %c{1.} %m` If it doesn't, please post an example of your logs here! – xav Jan 11 '21 at 03:03
  • Thanks @xav it works. But can you explain why you replaced %X with %mx. Where can I find details about this to learn more? – MyO Jan 11 '21 at 05:19
  • @MyO : it would also work with `%X`, but the column in LogMX would be named "core (MDC)". So to avoid having the suffix "(MDC)" on each `%X` column, you can use `%mx` instead. You can read more about this syntax in LogMX help: in the Log4j Parser creation dialog, click on the blue "?" icon (top right corner), or directly open the file "/help/log4j-patterns.html" – xav Jan 12 '21 at 03:05
0

Try the latest released version of Apache Chainsaw - http://logging.apache.org/chainsaw/2.x/

The Chainsaw configuration screen provides the option to parse local log files directly from a log4j xml configuration file (Use fileappender entries from a log4j config file option), or to specify the logFormat and log file yourself and have Chainsaw automatically start parsing logs (Process a log file option).

Chainsaw can also parse and tail log files available remotely via ssh using the VFSLogFilePatternReceiver - see the Welcome tab, View example receiver configuration, VFSLogFilePatternReceiverNoUserInfoPrompt example.

If you're using Log4j2, it's even easier to load events in to Chainsaw - just enable an advertiser and add the jmdns.jar on your appender side - see http://logging.apache.org/log4j/2.x/manual/configuration.html#ChainsawSupport

Scott
  • 1,728
  • 11
  • 11
  • I also tried to use Chainsaw for solr.log files but its has no help any where. Built in tutorial is full of TODO sections. I am a newbie & don know how to create Receivers for it or what to put in its sample receiver file. If its made for log4js, it should read log4js log files out of the box. Is there any readymade receiver available for solr or any detailed help somewhere? – MyO Jan 09 '21 at 11:04