12

Could someone recommend a good and free program for analysing Apache Tomcat logs. I don't need real-time analysis or anything like that. I have a log and I just want a quick and easy way to get some usage statistics from it. The stats don't even have to be too fancy - I just want a rough idea of unique users per day, week, and month really.

Thanks,

Bart.

Bart B
  • 3,457
  • 6
  • 31
  • 42

3 Answers3

3

You could use LambdaProbe :

http://www.lambdaprobe.org/d/index.htm

It's a nice webapps that only require that you relaunch Java. It provides nice features like live thread listing, and also parses log file (catalina.out) There is some nice monitoring (Session, threads, memory) and gives connector's load. At last (not least) it provides an interface to manage your webapps.

Razique
  • 2,276
  • 1
  • 19
  • 23
  • I love Lambdaprobe, but have been disappointed that there hasn't been an update since 11/2006. Works great on all my current stuff, but I'm worried that it's gonna start aging out. – Tim Howland Sep 08 '09 at 13:11
  • 4
    Ah, just found a fork of it for that reason: http://code.google.com/p/psi-probe/ – Tim Howland Sep 08 '09 at 13:12
  • psi-probe is interesting but in the long term... mmh: Build Status: failed, Coverity Scan: failed, Coverage Status: 25% – Massimo Sep 25 '18 at 04:55
  • And there is a ticket, 3 y old, asking to work with tomcat 8. – Massimo Sep 25 '18 at 04:56
2

Awstats would be a good choice i think.

There's a tutorial on how to set it up. http://www.turro.org/xp/Portal?xpc=1$@8$@1$@1&folder=20050104154634840

Edited some link brainlessness

pyhimys
  • 1,287
  • 10
  • 10
  • 1
    Awstats only allows to analyse logs in order to have statistics. That's not suitable for Tomcat logs imao – Razique Sep 08 '09 at 13:05
  • 2
    That is true. But the question was about usage statistics. As in http requests per second. Not java heap size. And awstats excels at that. – pyhimys Sep 09 '09 at 06:36
-1

Try this. make a ".sh" file and cron it to get the logs in the mail

#!/bin/bash 
cd [location of the catalina] 
ps -ef | grep tomcat | grep java | grep -v grep 
if [ $? -ne "0" ]; 
then 
rm -f .ref; 
exit 0 
fi 
export ALARM="$(cat catalina.out | wc -l)" if [ ! -f .ref ]; 
then 
echo $ALARM > .ref 
elif [ $ALARM -gt $(cat .ref) ]; 
then 
sed -n $(cat .ref),$(echo $ALARM)p Catalina.out | egrep -A 70 'SEVERE|ERROR' | egrep -v 'INFO|org.apache' > .reflog; 
elif [ $ALARM -eq $(cat .ref) ]; 
then 
exit 2 
fi 
export SIZE=$(ls -l .reflog | cut -d ' ' -f 5) if [ $SIZE -gt "0" ]; then cat .reflog | mail -s subject mail@goes.here 
fi 
echo $ALARM > .ref 
#EOF
Mark Henderson
  • 68,823
  • 31
  • 180
  • 259